:root {
  --xbox-green: #75bb3e;
  --bg-main: radial-gradient(circle at 50% 120%, #d5d8d9 0%, #cacbcb 100%);
  --text-primary: #333;
  --text-nav: #888;
  --tile-bg: #fff;
  --shadow-op: 0.1;
}

body.dark-mode {
  --bg-main: radial-gradient(circle at 50% 120%, #1a1a1a 0%, #0a0a0a 100%);
  --text-primary: #eee;
  --text-nav: #555;
  --tile-bg: #333;
  --shadow-op: 0.5;
}

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-primary);
  font-family: "Segoe UI", sans-serif;
  height: 100vh;
  overflow: hidden;
  transition: 0.4s;
}

/* User Interface Elements */
.user-bar {
  position: absolute;
  top: 30px;
  right: 50px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  z-index: 10;
}
.stats {
  font-size: 0.8rem;
  color: var(--text-nav);
  display: flex;
  gap: 10px;
}
.gamerpic {
  width: 55px;
  height: 55px;
  border: 2px solid #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.global-nav {
  margin-top: 80px;
  display: flex;
  justify-content: center;
}
.nav-list {
  display: flex;
  list-style: none;
  gap: 35px;
  padding: 0;
}
.nav-link {
  text-decoration: none;
  font-size: 2rem;
  color: var(--text-nav);
  transition: 0.3s;
}
.nav-link.active {
  color: var(--text-primary);
  transform: scale(1.1);
  font-weight: 600;
}

.panel-container {
  display: flex;
  align-items: center;
  gap: 150px; /* controls edge visibility */
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.panel:not(.active) {
  filter: blur(1px);
}

.stage {
  overflow: hidden;
  width: 100%;
  display: flex;
  justify-content: center;
}

.panel {
  width: 1000px;
  flex-shrink: 0;
  opacity: 0.25;
  transform: scale(0.88);
  transition: all 0.4s ease;
}

.panel.active {
  opacity: 1;
  transform: scale(1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Grid Logic */
.twist-grid {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tile {
  background: var(--tile-bg);
  position: relative;
  border: 3px solid transparent;
  cursor: pointer;
  transition: 0.2s;
  overflow: hidden;
  box-sizing: border-box;
}
.tile:hover {
  transform: scale(1.05);
  border-color: #fff;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

.hero {
  width: 480px;
  height: 352px;
  background-color: #333;
}
.square {
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.small-rect {
  width: 220px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.label {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 12px;
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  box-sizing: border-box;
}

/* Social & Settings */
.social-hub {
  display: flex;
  gap: 60px;
  align-items: center;
  justify-content: center;
}
.green-btn {
  width: 240px;
  height: 50px;
  background: #444;
  color: #fff;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  transition: 0.2s;
}
.green-btn.active {
  background: var(--xbox-green);
  transform: scale(1.05);
  border: 2px solid #fff;
}
.standing-avatar {
  height: 300px;
  filter: drop-shadow(0 15px 10px rgba(0, 0, 0, var(--shadow-op)));
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 200px);
  gap: 12px;
  justify-content: center;
}
.icon-tile {
  height: 160px;
  background: var(--xbox-green);
  color: #fff;
  font-size: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Modals */
#guide-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}
.text-dialog {
  width: 500px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
}
.guide-item {
  padding: 15px;
  background: #252525;
  color: #fff;
  cursor: pointer;
  border-left: 5px solid transparent;
}
.guide-item.active {
  background: #333;
  border-left-color: var(--xbox-green);
  color: var(--xbox-green);
}

/* Legend Symbols */
.legend {
  position: fixed;
  bottom: 30px;
  left: 60px;
  display: flex;
  gap: 20px;
}
.btn-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: bold;
  font-size: 0.7rem;
  margin-right: 8px;
}
.btn-a {
  background: #5cb85c;
}
.btn-b {
  background: #d9534f;
}

/* Fix Google Search Box */
.search-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 350px;
}

.search-box {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--text-nav);
  padding: 15px 25px;
  display: flex;
  align-items: center;
  gap: 20px;
  width: 600px;
  transition: 0.3s;
}

.search-box:focus-within {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.search-box input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  width: 100%;
  outline: none;
}

/* Fix Social Grid to match Home Grid */
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 170px);
  grid-template-rows: repeat(2, 170px);
  gap: 12px;
}

.social-tile {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #444;
}

.social-tile.active,
.social-tile:hover {
  background-color: var(--xbox-green);
  border-color: #fff;
}

/* Metro Stage Styling */
.panel.active {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

.floor-shadow {
  position: fixed;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 300px;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.3) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
}
