/* ====================================
   CSS VARIABLES & RESET
   ==================================== */

:root {
  color-scheme: dark;

  /* Base theme (dark) */
  --bg: #0e1a40;
  --bg-soft: #14235a;
  --bg-deep: #0b1331;
  --card: #1d2f6d;
  --card-deep: #19295b;
  --accent: #2e51ff;
  --accent-strong: #4d6bff;
  --accent-soft: rgba(46, 81, 255, 0.35);
  --text: #f7f9ff;
  --muted: rgba(247, 249, 255, 0.74);
  --shadow: rgba(4, 10, 30, 0.55);
  --outline: rgba(255, 255, 255, 0.28);
  --particle-color: rgba(255, 255, 255, 0.9);
  --nav-bg: rgba(10, 18, 45, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background-color: var(--bg);
}

body {
  min-height: 100vh;
  font-family: "Montserrat", system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
  transition: background 0.6s ease, color 0.3s ease;
}

body.modal-open {
  overflow: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 55%, var(--bg-deep) 100%);
  z-index: -1;
  pointer-events: none;
  opacity: 1;
}

#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.8;
  pointer-events: none;
}

/* ====================================
   THEMES (data-theme attribute)
   ==================================== */

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes skyPulse {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

body[data-theme="midnight"] {
  --bg: #0b153d;
  --bg-soft: #111f52;
  --bg-deep: #091333;
  --card: #1a2f6f;
  --card-deep: #152659;
  --accent: #3f6bff;
  --accent-strong: #5d82ff;
  --accent-soft: rgba(63, 107, 255, 0.45);
  --particle-color: rgba(208, 220, 255, 0.9);
  --nav-bg: rgba(10, 16, 40, 0.62);
  background: radial-gradient(circle at top, #1e293b, #020617);
}

body[data-theme="neon-tide"] {
  --bg: #091a2f;
  --bg-soft: #0f2645;
  --bg-deep: #061427;
  --card: #153865;
  --card-deep: #0e2a4d;
  --accent: #53ffd9;
  --accent-strong: #25e9c7;
  --accent-soft: rgba(83, 255, 217, 0.28);
  --particle-color: rgba(83, 255, 217, 0.8);
  --nav-bg: rgba(7, 26, 45, 0.7);
  background: linear-gradient(-45deg, #2e0249, #570a57, #a91079);
  background-size: 400% 400%;
  animation: gradient-shift 12s ease infinite;
}

body[data-theme="sunset-drive"] {
  --bg: #2a1438;
  --bg-soft: #351a4b;
  --bg-deep: #1c0d2a;
  --card: #4b225c;
  --card-deep: #3d1b50;
  --accent: #ff6a9f;
  --accent-strong: #ff4b85;
  --accent-soft: rgba(255, 106, 159, 0.35);
  --particle-color: rgba(255, 214, 230, 0.9);
  --nav-bg: rgba(42, 20, 56, 0.65);
  background: linear-gradient(120deg, #ff6b6b, #556270);
  background-size: 200% 200%;
  animation: gradient-shift 10s ease infinite;
}

body[data-theme="aero-glass"] {
  --bg: #0b1a36;
  --bg-soft: #112046;
  --bg-deep: #0a132d;
  --card: rgba(26, 52, 104, 0.65);
  --card-deep: rgba(18, 42, 92, 0.7);
  --accent: #6bf7ff;
  --accent-strong: #38d6ff;
  --accent-soft: rgba(107, 247, 255, 0.25);
  --particle-color: rgba(107, 247, 255, 0.75);
  --nav-bg: rgba(14, 30, 66, 0.62);
  background: linear-gradient(180deg, #bce6ff 0%, #f0f9ff 100%);
}

body[data-theme="aero-glass"] .card,
body[data-theme="aero-glass"] .game-card,
body[data-theme="aero-glass"] .movie-card,
body[data-theme="aero-glass"] .theme-card {
  backdrop-filter: blur(14px);
  border: 1px solid rgba(153, 223, 255, 0.25);
  box-shadow: 0 18px 30px rgba(8, 20, 40, 0.35);
}

body[data-theme="aero-glass"] .player-btn,
body[data-theme="aero-glass"] .control-btn,
body[data-theme="aero-glass"] .theme-apply,
body[data-theme="aero-glass"] .action-buttons .watch-btn,
body[data-theme="aero-glass"] .play-btn {
  background: linear-gradient(135deg, rgba(107, 247, 255, 0.85), rgba(37, 140, 200, 0.9));
  color: #0c1a2b;
}

body[data-theme="aero-glass"] .site-nav {
  background: rgba(178, 230, 255, 0.22);
  border: 1px solid rgba(178, 230, 255, 0.3);
}

body[data-theme="daylight"] {
  --bg: #fdfbfb;
  --bg-soft: #ebedee;
  --bg-deep: #ffffff;
  --card: rgba(255, 255, 255, 0.85);
  --card-deep: rgba(245, 247, 250, 0.8);
  --text: #2d3748;
  --muted: #718096;
  --shadow: rgba(0, 0, 0, 0.08);
  --outline: rgba(0, 0, 0, 0.1);
  --accent: #3182ce;
  --accent-strong: #2c5282;
  --accent-soft: rgba(49, 130, 206, 0.15);
  --particle-color: rgba(49, 130, 206, 0.5);
  --nav-bg: rgba(255, 255, 255, 0.9);
  background: linear-gradient(120deg, #a1c4fd 0%, #c2e9fb 100%);
  background-attachment: fixed;
}

body[data-theme="cloud-nine"] {
  --bg: #101b40;
  --bg-soft: #1a2a60;
  --bg-deep: #0a1433;
  --card: #24387a;
  --card-deep: #1b2d68;
  --accent: #9ee6ff;
  --accent-strong: #6fd3ff;
  --accent-soft: rgba(158, 230, 255, 0.3);
  --particle-color: rgba(158, 230, 255, 0.85);
  --nav-bg: rgba(14, 24, 55, 0.66);
  background: linear-gradient(to bottom, #dbeafe, #eff6ff);
}

body[data-theme="ember-haze"] {
  --bg: #2b1417;
  --bg-soft: #3a1a1f;
  --bg-deep: #1b0a0d;
  --card: #53242b;
  --card-deep: #3f1a1f;
  --accent: #ff9a6b;
  --accent-strong: #ff7a44;
  --accent-soft: rgba(255, 154, 107, 0.35);
  --particle-color: rgba(255, 100, 50, 0.8);
  --nav-bg: rgba(44, 20, 23, 0.7);
  background: linear-gradient(to bottom right, #2b1417, #4a0e0e, #5c1515);
  background-size: 200% 200%;
  animation: gradient-shift 10s ease infinite;
}

body[data-theme="aurora-flow"] {
  --bg: #0b1b24;
  --bg-soft: #12303b;
  --bg-deep: #061017;
  --card: #1b3f4d;
  --card-deep: #142f3a;
  --accent: #7cffd6;
  --accent-strong: #4ff0c2;
  --accent-soft: rgba(124, 255, 214, 0.32);
  --particle-color: rgba(100, 255, 150, 0.6);
  --nav-bg: rgba(9, 25, 31, 0.7);
  background: linear-gradient(135deg, #0f2027, #2a0e36, #002a2a);
  background-size: 300% 300%;
  animation: gradient-shift 15s ease infinite;
}

body[data-theme="starlight"] {
  --bg: #0f1234;
  --bg-soft: #171a43;
  --bg-deep: #0b0d26;
  --card: #23275b;
  --card-deep: #1b1f4a;
  --accent: #b5a4ff;
  --accent-strong: #957dff;
  --accent-soft: rgba(181, 164, 255, 0.35);
  --particle-color: rgba(220, 210, 255, 0.9);
  --nav-bg: rgba(12, 14, 40, 0.72);
  background: #000;
  background-image:
    radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 3px),
    radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 2px),
    radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 3px);
  background-size: 550px 550px, 350px 350px, 250px 250px;
}

body[data-theme="custom"] {
  background-attachment: fixed;
}

body[data-theme="dizzy"] {
  --bg: #0a0a0c;
  --bg-soft: #141419;
  --bg-deep: #000000;
  --card: #1a1a20;
  --card-deep: #111116;
  --accent: #800020;
  --accent-strong: #a3002b;
  --accent-soft: rgba(128, 0, 32, 0.25);
  --text: #dcdcdc;
  --muted: #777777;
  --shadow: rgba(0, 0, 0, 0.9);
  --outline: rgba(255, 255, 255, 0.1);
  --particle-color: rgba(100, 100, 100, 0.4);
  --nav-bg: rgba(15, 15, 20, 0.85);
  background: radial-gradient(circle at 50% 30%, #1f0505, #0a0a0c);
}

body[data-theme="sonic"] {
  --bg: #0f2cd1;
  --bg-soft: #1c44eb;
  --bg-deep: #05166b;
  --card: #0a1e64;
  --card-deep: #051450;
  --accent: #ffcc00;
  --accent-strong: #ffaa00;
  --accent-soft: rgba(255, 204, 0, 0.3);
  --text: #ffffff;
  --muted: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.6);
  --outline: rgba(255, 255, 255, 0.25);
  --particle-color: rgba(255, 204, 0, 0.7);
  --nav-bg: #0a1e64;
  background: url('../assets/sonic.gif') no-repeat center center fixed;
  background-size: cover;
}

/* Sonic theme overrides */
body[data-theme="sonic"] #site-search,
body[data-theme="sonic"] #sj-address,
body[data-theme="sonic"] #uv-address,
body[data-theme="sonic"] #game-search,
body[data-theme="sonic"] #movie-search,
body[data-theme="sonic"] #search-input,
body[data-theme="sonic"] .control-btn {
  background-image: none;
  background-color: #0f53ff;
  box-shadow: 0 0 0 2px var(--outline);
  color: #fff;
}

body[data-theme="sonic"] #sj-address::placeholder,
body[data-theme="sonic"] #site-search::placeholder,
body[data-theme="sonic"] #game-search::placeholder,
body[data-theme="sonic"] #movie-search::placeholder,
body[data-theme="sonic"] #search-input::placeholder {
  color: rgba(255, 255, 255, 0.92);
}

body[data-theme="sonic"] #sort-dropdown {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-color: var(--card);
  box-shadow: 0 0 0 2px var(--outline);
  color: var(--text);
}

/* Global animation toggle */
body[data-animated="true"] {
  animation: skyPulse 12s ease-in-out infinite;
}

/* ====================================
   LAYOUT
   ==================================== */

.page,
.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 20px 32px 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.page-shell {
  gap: 22px;
}

.logo {
  font-weight: 900;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.03em;
  text-transform: lowercase;
  text-shadow: 0 10px 24px var(--shadow);
  margin-top: 10px;
}

.welcome-widget {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: 0 10px 20px var(--shadow);
  text-align: center;
}

.welcome-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  text-transform: lowercase;
}

.welcome-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: lowercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-header {
  width: min(1200px, 92vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.site-header.centered {
  position: relative;
  flex-direction: column;
}

.site-header.centered .hamburger-menu {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1003;
}

.site-nav {
  display: flex;
  gap: 16px;
  font-weight: 800;
  text-transform: lowercase;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  background: var(--nav-bg);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 28px var(--shadow);
}

.site-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a.active,
.site-nav a:hover {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
}

/* ====================================
   COMMON COMPONENTS
   ==================================== */

/* Cards */
.cards {
  width: min(980px, 92vw);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 10px;
}

.card-grid {
  width: min(1100px, 92vw);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.card {
  background: linear-gradient(180deg, var(--card) 0%, var(--card-deep) 100%);
  border-radius: 18px;
  min-height: 150px;
  box-shadow: 0 18px 30px var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.1s ease-out, box-shadow 0.2s ease, border-color 0.2s ease;
  transform-style: preserve-3d;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 50px var(--shadow);
  border-color: rgba(255, 255, 255, 0.14);
}

.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 4px;
  border-radius: 12px;
}

.card h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  text-transform: lowercase;
}

.card p {
  margin: 0;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
}

.game-card:hover .game-image {
  transform: scale(1.05);
}

.game-image {
  transition: transform 0.3s ease;
}

.links-card {
  width: min(1100px, 96vw);
}

.links-card .card-link {
  gap: 18px;
}

.links-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  line-height: 1.6;
}

.links-list a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.links-list a:hover {
  color: #fff;
  text-decoration: underline;
}

.themes-card .card-link {
  gap: 18px;
}

/* Buttons */
.control-btn {
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, var(--card) 0%, var(--card-deep) 100%);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.control-btn:hover,
.control-btn.active {
  transform: translateY(-2px);
  background: var(--accent);
  color: #0b2b10;
  border-color: transparent;
}

.theme-apply {
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1435;
  font-weight: 900;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(6, 12, 34, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-apply:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(6, 12, 34, 0.45);
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-deep) 100%);
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: lowercase;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 16px var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px var(--shadow);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--card) 100%);
}

.quick-btn:active {
  transform: translateY(0);
}

.quick-icon {
  font-size: 1.5rem;
  line-height: 1;
}

/* Forms & Inputs */
.search-container {
  width: min(600px, 90%);
  display: flex;
  justify-content: center;
  margin: 18px 0;
  z-index: 2;
}

#search-form {
  display: flex;
  width: 100%;
  gap: 10px;
}

#site-search,
#game-search,
#movie-search,
#search-input {
  flex: 1;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  background-color: var(--bg);
  background-image: linear-gradient(180deg, var(--card) 0%, var(--card-deep) 100%);
  box-shadow: 0 18px 30px var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  outline: none;
}

#site-search::placeholder,
#game-search::placeholder,
#movie-search::placeholder,
#search-input::placeholder {
  color: var(--muted);
}

#search-form button {
  padding: 0 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  font-size: 1rem;
  font-weight: 800;
  color: #0b2b10;
  cursor: pointer;
  box-shadow: 0 12px 24px var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#search-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px var(--shadow);
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

#sort-dropdown,
.settings-select {
  padding: 12px 20px;
  padding-right: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px;
  color: var(--text);
  font-weight: 700;
  outline: none;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  appearance: none;
  font-family: inherit;
}

.settings-select {
  width: 100%;
}

#sort-dropdown {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"),
    linear-gradient(180deg, var(--card) 0%, var(--card-deep) 100%);
  background-repeat: no-repeat, repeat;
  background-size: 12px, auto;
}

.settings-select option {
  background: #0b153d;
  color: #fff;
}

/* Dropdowns & Menus */
.hamburger-menu {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.hamburger-menu span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text);
  margin: 0 0 4px;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-menu:hover span {
  background: var(--accent);
}

.hamburger-menu.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.apps-dropdown {
  position: fixed;
  top: 70px;
  left: 16px;
  background: rgba(10, 18, 45, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  z-index: 1002;
  min-width: 200px;
  box-shadow: 0 12px 32px var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.apps-dropdown.show {
  opacity: 1;
  visibility: visible;
}

.apps-dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.apps-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.apps-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.1);
}

.apps-dropdown-icon {
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border-radius: 6px;
  overflow: hidden;
}

.apps-dropdown-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.apps-dropdown-info h4 {
  margin: 0 0 2px;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: lowercase;
  color: var(--text);
}

.apps-dropdown-info p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.apps-dropdown-pin {
  background: none;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.apps-dropdown-pin:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.apps-dropdown-pin.pinned {
  opacity: 1;
  background: rgba(46, 255, 138, 0.2);
  color: rgba(46, 255, 138, 0.9);
}

.no-apps-message {
  display: grid;
  gap: 10px;
}

.apps-empty-cta {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 800;
  text-transform: lowercase;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.apps-empty-cta:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Quick Access */
.quick-access {
  width: min(980px, 92vw);
  margin: 16px 0;
}

.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* Ads */
.ad-slot {
  width: min(760px, 92vw);
  min-height: 90px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: transparent;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.ad-slot-inner {
  width: 728px;
  height: 90px;
  max-width: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.ad-slot iframe,
.ad-slot object,
.ad-slot embed {
  max-width: 100%;
}

.ad-slot.secondary {
  width: min(640px, 84vw);
  background: rgba(10, 18, 45, 0.32);
}

.ad-slot.has-ad {
  padding: 12px;
  margin: 6px 0;
}

.ad-slot.secondary.has-ad {
  padding: 10px;
}

.ad-slot.ad-slot--collapsed {
  display: none !important;
}

.ad-fallback {
  width: min(760px, 92vw);
  min-height: 86px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: linear-gradient(180deg, rgba(14, 24, 58, 0.68) 0%, rgba(12, 20, 48, 0.62) 100%);
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 14px 20px;
}

.ad-fallback p {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.ad-fallback small {
  display: block;
  line-height: 1.35;
  max-width: 68ch;
}

.player-ad {
  position: fixed;
  z-index: 20;
  min-width: 280px;
  max-width: 360px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.player-ad.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

body[data-ad-position="top-left"] .player-ad {
  top: 16px;
  left: 16px;
}

body[data-ad-position="top-right"] .player-ad {
  top: 16px;
  right: 16px;
}

body[data-ad-position="bottom-left"] .player-ad {
  bottom: 16px;
  left: 16px;
}

body[data-ad-position="bottom-right"] .player-ad {
  bottom: 16px;
  right: 16px;
}

.global-ad-container {
  position: relative;
  width: min(1200px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: auto;
  gap: 10px;
  padding: 8px 0 2px;
  margin: 0 auto;
}

.global-ad-container.hidden {
  display: none !important;
}

/* Player */
.player-shell {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 30, 0.7);
  backdrop-filter: blur(10px);
  padding: 24px;
  z-index: 1200;
}

.player-content {
  width: min(1100px, 92vw);
  background: rgba(8, 14, 32, 0.92);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.player-header {
  padding: 14px 18px;
  background: rgba(18, 26, 52, 0.95);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-weight: 800;
}

.player-header span {
  font-size: 1rem;
}

.player-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.player-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.player-btn.primary {
  background: var(--accent);
  color: #0b2b10;
  border-color: transparent;
}

.player-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(12, 20, 50, 0.92);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.player-select option {
  background: #0d1634;
  color: #fff;
}

.player-iframe {
  width: 100%;
  height: min(65vh, 680px);
  border: none;
}

.player-content.is-maximized {
  position: fixed;
  inset: 20px;
  z-index: 1200;
  width: auto;
  max-width: none;
}

.player-content.is-maximized .player-iframe {
  height: calc(100vh - 120px);
}

.player-content:fullscreen {
  width: 100vw;
  height: 100vh;
  border: none;
  border-radius: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  margin: 0 !important;
}

.player-content:fullscreen .player-header {
  display: none !important;
}

.player-content:fullscreen .player-iframe {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  flex: 1;
  border-radius: 0 !important;
}

/* Modals */
.modal-backdrop,
.login-modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 22, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2000;
}

.login-modal {
  display: none;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal {
  width: min(680px, 92vw);
  background: #101a34;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal-content {
  background-color: var(--card);
  margin: auto;
  padding: 20px;
  border: 1px solid var(--outline);
  width: 80%;
  max-width: 400px;
  border-radius: 10px;
  box-shadow: 0 5px 15px var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(18, 26, 52, 0.95);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-body {
  padding: 18px 20px 22px;
  display: grid;
  gap: 14px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.5;
}

.close-button {
  color: var(--muted);
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover,
.close-button:focus {
  color: var(--text);
  text-decoration: none;
}

.modal-content input {
  width: calc(100% - 20px);
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--outline);
  border-radius: 5px;
  background-color: var(--bg-soft);
  color: var(--text);
}

.modal-content button {
  background-color: var(--accent);
  color: var(--bg);
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  font-weight: 700;
}

.modal-content button:hover {
  background-color: var(--accent-strong);
}

.modal-content .google-btn {
  background-color: #db4437;
}

.modal-content .google-btn:hover {
  background-color: #c23321;
}

.modal-content p {
  color: var(--text);
  text-align: center;
  margin-bottom: 10px;
}

.modal-content .error-message {
  color: #ff6b6b;
  text-align: center;
  margin-top: 10px;
}

/* Info Grid & Tags */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.info-row strong {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 6px;
}

/* Themes Grid */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.theme-card {
  background: rgba(15, 25, 55, 0.6);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 10px;
  min-height: 160px;
  overflow: hidden;
}

.theme-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  text-transform: lowercase;
}

.theme-preview {
  height: 70px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2e51ff, #09143a);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.theme-card .theme-chip {
  justify-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-weight: 800;
}

/* Theme preview variants */
.theme-preview.midnight { background: linear-gradient(135deg, #2f55ff, #07102c); }
.theme-preview.neon-tide { background: linear-gradient(135deg, #46ffd7, #0d1f46); }
.theme-preview.sunset-drive { background: linear-gradient(135deg, #ff6aa4, #2a0f3b); }
.theme-preview.ember-haze { background: linear-gradient(135deg, #2b1417, #ff9a6b); }
.theme-preview.aurora-flow { background: linear-gradient(135deg, #0b1b24, #7cffd6); }
.theme-preview.starlight { background: linear-gradient(135deg, #0f1234, #b5a4ff); }
.theme-preview.sonic { background: linear-gradient(135deg, #0f2cd1, #ffcc00); }

.theme-card[data-animated="true"] .theme-preview {
  background-size: 200% 200%;
  animation: themeShift 8s ease-in-out infinite;
}

@keyframes themeShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Settings */
.settings-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: min(1100px, 96vw);
  align-items: stretch;
}

.settings-layout {
  display: flex;
  gap: 30px;
  width: min(1100px, 96vw);
  align-items: flex-start;
}

.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 220px;
  flex-shrink: 0;
}

.settings-content {
  flex: 1;
  background: linear-gradient(180deg, var(--card) 0%, var(--card-deep) 100%);
  border-radius: 24px;
  padding: 32px;
  border: 1px solid var(--outline);
  box-shadow: 0 20px 40px var(--shadow);
  backdrop-filter: blur(24px);
  min-height: 500px;
  position: relative;
  z-index: 1;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 10px;
}

.setting-group {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background 0.2s ease;
}

.setting-group:hover {
  background: rgba(0, 0, 0, 0.7);
}

.setting-group h3 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: lowercase;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-row label {
  font-size: 0.75rem;
  text-transform: lowercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.setting-row input,
.setting-row select {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 12px;
  font-weight: 700;
}

.setting-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.setting-toggle input {
  width: 42px;
  height: 22px;
  appearance: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.setting-toggle input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.setting-toggle input:checked {
  background: var(--accent);
}

.setting-toggle input:checked::after {
  transform: translateX(18px);
}

.tab-btn {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  border: none;
  color: var(--muted);
  text-align: left;
  padding: 14px 20px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  text-transform: lowercase;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.tab-btn.active {
  color: var(--text);
  background: linear-gradient(90deg, var(--card) 0%, var(--card-deep) 100%);
  box-shadow: 0 4px 12px var(--shadow);
  border: 1px solid var(--outline);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

.tab-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--outline);
}

.tab-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: lowercase;
}

.settings-panel {
  height: 100%;
}

.custom-theme-creator {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: none;
}

.custom-theme-creator.active {
  display: block;
  animation: slideIn 0.3s ease;
}

.color-input-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
  border-radius: 8px;
}

.color-input-group input[type="color"] {
  border: none;
  width: 40px;
  height: 30px;
  cursor: pointer;
  background: none;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 3000;
  color: var(--text);
  overflow: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--accent-soft) 88%, transparent), transparent 55%),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg) 85%, transparent) 0%,
      color-mix(in srgb, var(--bg-soft) 85%, transparent) 55%,
      color-mix(in srgb, var(--bg-deep) 88%, transparent) 100%
    );
  z-index: -1;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-title {
  font-weight: 900;
  text-transform: lowercase;
  letter-spacing: 0.08em;
}

.loading-phrase {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-style: italic;
  margin-top: 15px;
  text-transform: lowercase;
  text-align: center;
  max-width: 80%;
}

.loading-bar {
  width: min(320px, 70vw);
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  transition: width 0.2s ease;
}

.loading-percent {
  font-weight: 700;
  color: var(--muted);
}

.loading-skip {
  margin-top: 4px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
}

.loading-skip.show {
  opacity: 1;
  transform: translateY(0);
}

.loading-skip:hover {
  background: rgba(0, 0, 0, 0.38);
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.app-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(15, 25, 55, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.app-item:hover {
  background: rgba(15, 25, 55, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--shadow);
  border-color: rgba(255, 255, 255, 0.15);
}

.app-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border-radius: 12px;
  flex-shrink: 0;
}

.app-info {
  flex: 1;
}

.app-info h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: lowercase;
  color: var(--text);
}

.app-info p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.app-pin {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.app-pin:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.app-pin.pinned {
  opacity: 1;
  background: rgba(46, 255, 138, 0.2);
  color: rgba(46, 255, 138, 0.9);
}

/* User / Profile */
.user-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.users-total-count {
  margin: 0;
  font-weight: 800;
  color: var(--muted);
}

.users-pagination {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.users-page-btn {
  border: 1px solid var(--outline);
  background: linear-gradient(180deg, var(--card) 0%, var(--card-deep) 100%);
  color: var(--text);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
}

.users-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.users-page-label {
  min-width: 86px;
  text-align: center;
  font-weight: 700;
}

.user-item {
  background-color: var(--bg-soft);
  margin-bottom: 10px;
  padding: 15px 20px;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  border: 1px solid var(--outline);
  transition: background-color 0.2s ease;
  position: relative;
  z-index: 2;
}

.user-item:hover {
  background-color: var(--card);
}

.user-item span {
  font-weight: 600;
  word-break: break-word;
}

.user-item span strong {
  color: var(--muted);
  font-weight: 800;
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--outline);
  background: var(--card);
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.user-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  width: fit-content;
}

.user-profile-link:hover {
  background: rgba(255, 255, 255, 0.14);
}

.profile-preview-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.profile-preview-image {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--outline);
  background: var(--card);
}

.profile-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-meta-line {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  word-break: break-all;
}

.profile-status-text {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

#profile-name,
#profile-bio,
#profile-photo {
  width: 100%;
}

#profile-bio {
  resize: vertical;
  min-height: 84px;
}

/* Save Indicator */
.save-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(46, 255, 138, 0.1);
  border: 1px solid rgba(46, 255, 138, 0.3);
  color: rgba(46, 255, 138, 0.9);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.save-indicator.show {
  opacity: 1;
}

.save-icon {
  font-size: 0.8rem;
}

/* Entry Phrase */
.entry-phrase {
  margin: 15px 0 5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: lowercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  text-align: center;
  font-style: italic;
}

/* Pill */
.pill {
  background: rgba(12, 26, 62, 0.6);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Credits Row */
.credits-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}

.credits-row .card {
  flex: 1 1 220px;
}

/* Construction Popup */
.construction-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.construction-popup.show {
  opacity: 1;
  visibility: visible;
}

.construction-content {
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.construction-popup.show .construction-content {
  transform: scale(1);
}

.construction-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.construction-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 16px;
  color: var(--accent);
  text-transform: uppercase;
}

.construction-message {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 30px;
  line-height: 1.6;
}

.construction-close {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.construction-close:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(46, 81, 255, 0.4);
}

/* Custom Popup */
.custom-popup {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 25, 55, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 24px;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.custom-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.popup-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Login Button */
#login-button {
  position: fixed;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--nav-bg);
  border: 1px solid var(--outline);
  color: var(--text);
  padding: 5px;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Montserrat", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.3s ease;
  white-space: nowrap;
  z-index: 1003;
}

#login-button:hover {
  background: var(--card);
}

#login-button img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

#login-button span {
  padding: 0 10px 0 4px;
}

/* Utilities */
.hidden {
  display: none !important;
}

/* ====================================
   MEDIA QUERIES
   ==================================== */

@media (max-width: 900px) {
  .settings-container {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-header {
    flex-direction: column;
  }

  .ad-slot {
    min-height: 50px;
  }

  .ad-slot-inner {
    width: 320px;
    height: 50px;
  }

  .ad-fallback {
    min-height: 66px;
  }

  .site-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 8px;
    border-radius: 16px;
  }

  .settings-content {
    padding: 20px 16px;
    border-radius: 16px;
    min-height: auto;
  }

  .profile-preview-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 800px) {
  .settings-layout {
    flex-direction: column;
  }

  .settings-sidebar {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  .apps-dropdown {
    top: 60px;
    left: 16px;
    right: auto;
    min-width: 180px;
  }

  .page,
  .page-shell {
    padding: 20px 16px 70px;
  }

  .cards {
    gap: 18px;
  }

  .site-header.centered {
    padding-top: 60px;
  }

  .search-container {
    width: 100%;
    max-width: none;
  }

  .search-input {
    font-size: 1rem;
    padding: 12px 16px;
  }

  .card-link {
    padding: 20px 16px;
  }

  .card h2 {
    font-size: 1.2rem;
  }

  .card p {
    font-size: 0.9rem;
  }

  body[data-theme="sonic"] {
    background-attachment: scroll !important;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
  }
}

@media (max-width: 720px) {
  .page,
  .page-shell {
    padding: 32px 20px 80px;
  }

  .player-iframe {
    height: 52vh;
  }
}

@media (max-width: 640px) {
  .page,
  .page-shell {
    padding: 16px 12px 72px;
    gap: 16px;
  }

  .logo {
    margin-top: 10px;
    text-align: center;
  }

  .site-header {
    width: 100%;
    gap: 10px;
  }

  .welcome-widget {
    width: 100%;
    padding: 9px 12px;
  }

  .welcome-title {
    font-size: 0.92rem;
  }

  .welcome-subtitle {
    font-size: 0.76rem;
    gap: 6px;
  }

  .cards {
    width: 100%;
    gap: 12px;
  }

  .settings-sidebar {
    gap: 6px;
    padding-bottom: 6px;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .modal-content {
    width: 92vw;
    max-width: 92vw;
    padding: 16px;
  }

  #login-button {
    top: 0.55rem;
    right: 0.55rem;
    font-size: 0.74rem;
  }

  #login-button img {
    width: 24px;
    height: 24px;
  }
}
