* { box-sizing: border-box; }
:root {
  --accent-gold: #c4a47c;
  --text-white: #ffffff;
  --bg-dark: #0a0a0a;
}

html,body { height:100%; margin:0; background:#87CEEB; font-family:Arial,Helvetica,sans-serif }
canvas { display:block; position: fixed; top: 0; left: 0; z-index: 1; pointer-events: none; }
#ui { position:fixed; left:12px; top:12px; color:#fff; z-index:10; text-shadow:0 1px 2px rgba(0,0,0,0.6); pointer-events: auto; }
#score { font-weight:700; font-size:18px; margin-bottom:6px }
#help { font-size:13px; opacity:0.9 }
#restart { margin-top:6px; padding:6px 10px; font-size:14px; pointer-events: auto; }

#leaderboard-mini {
  margin-top: 10px;
  width: min(340px, calc(100vw - 24px));
  background: rgba(10, 10, 10, 0.84);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 12px 30px rgba(0,0,0,0.42);
  border-radius: 10px;
  color: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  padding: 10px;
}

#leaderboard-list-mini {
  font-size: 12px;
}

@media (max-width: 768px) {
  #leaderboard-mini {
    display: none !important;
  }
}
.perf-overlay {
  position: fixed;
  right: 12px;
  top: 12px;
  z-index: 20;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  font-family: "Courier New", monospace;
  padding: 6px 8px;
  border-radius: 6px;
  pointer-events: none;
  display: none;
  white-space: nowrap;
}

/* Overlay bij Game Over */
.hidden { display:none !important }

/* Ensure hidden wins over menu/shop display rules */
#main-menu.hidden,
#skin-shop.hidden {
  display: none !important;
}
#overlay { 
  position:fixed; 
  left:0; 
  top:0; 
  right:0; 
  bottom:0; 
  display:flex; 
  align-items:center; 
  justify-content:center; 
  z-index:2000;
  background: rgba(0, 0, 0, 0.78);
  pointer-events: auto;
}
.overlay-box {
  width: min(760px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  padding: 24px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(14px);
}

.overlay-box h1 {
  margin: 0 0 8px 0;
  font-size: clamp(40px, 7vw, 62px);
  font-family: 'Bebas Neue', Arial, sans-serif;
  letter-spacing: 0.09em;
  line-height: 0.96;
  border-bottom: 1px solid rgba(196,164,124,0.5);
  padding-bottom: 10px;
  width: 100%;
}

.overlay-box #overlay-score {
  font-size: 18px;
  color: rgba(255,255,255,0.92);
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
}

.game-over-suggestions {
  width: min(520px, 100%);
  text-align: left;
  border: 1px solid rgba(196,164,124,0.35);
  border-radius: 10px;
  background: rgba(196,164,124,0.08);
  padding: 10px 12px;
  color: rgba(255,255,255,0.9);
}

.game-over-suggestions h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
}

.game-over-suggestions ul {
  margin: 0;
  padding-left: 18px;
}

.game-over-suggestions li {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.4;
}

.jumpscare-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(255, 0, 0, 0.12);
  animation: jumpscareFlash 0.16s ease-in-out infinite alternate;
}

.jumpscare-message {
  color: #ffffff;
  font-family: 'Bebas Neue', Arial, sans-serif;
  letter-spacing: 0.16em;
  font-size: clamp(42px, 10vw, 120px);
  text-shadow: 0 0 24px rgba(255, 30, 30, 0.9);
}

@keyframes jumpscareFlash {
  from {
    background: rgba(255, 0, 0, 0.1);
  }
  to {
    background: rgba(255, 255, 255, 0.16);
  }
}

#leaderboard-panel {
  margin-top: 6px;
  width: min(520px, 100%);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
  text-align: left;
}

#leaderboard-panel h3 {
  margin: 0 0 10px 0;
  text-align: center;
  color: rgba(255,255,255,0.95);
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
}

#leaderboard-list {
  max-height: min(44vh, 340px);
  overflow-y: auto;
}

.overlay-lb-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  color: rgba(255,255,255,0.92);
}

.overlay-lb-score {
  font-weight: 700;
  min-width: 70px;
  text-align: right;
  color: var(--accent-gold);
}

.mp-round-board {
  margin-top: 12px;
  text-align: left;
  width: 100%;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.mp-round-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  color: rgba(255,255,255,0.95);
}

.mp-round-list {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}

.mp-round-row {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.mp-round-row:first-child {
  border-top: none;
}

.mp-round-row:nth-child(odd) {
  background: rgba(255,255,255,0.03);
}

.mp-round-row.is-local {
  background: rgba(196,164,124,0.16);
}

.mp-round-row.is-winner {
  font-weight: 700;
}

.mp-round-score {
  font-weight: 700;
  color: var(--accent-gold);
}

.mp-round-delta {
  font-size: 11px;
  opacity: 0.65;
  color: rgba(255,255,255,0.82);
}

.mp-round-note {
  margin-top: 12px;
  font-size: 13px;
  text-align: center;
  opacity: 0.82;
}

.pause-overlay {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.78);
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.pause-dialog {
  width: min(560px, 92vw);
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 30px 24px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  backdrop-filter: blur(14px);
}

.pause-title {
  color: #fff;
  margin: 0 0 14px 0;
  font-size: clamp(42px, 8vw, 64px);
  font-family: 'Bebas Neue', Arial, sans-serif;
  letter-spacing: 0.09em;
  line-height: 0.95;
  border-bottom: 1px solid rgba(196,164,124,0.5);
  padding-bottom: 10px;
}

.pause-subtitle {
  color: rgba(255,255,255,0.82);
  font-size: 16px;
  margin: 8px 0 14px;
}

.pause-btn {
  display: block;
  width: min(320px, 100%);
  margin: 12px auto 0;
  padding: 11px 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.95);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(196,164,124,0.56);
  border-radius: 0;
  cursor: pointer;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s ease, border-color 0.2s ease;
  outline: 3px solid transparent;
}

.pause-btn:hover,
.pause-btn:focus-visible {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.pause-btn-danger {
  border-bottom-color: rgba(255,120,120,0.62);
}

.pause-btn-danger:hover,
.pause-btn-danger:focus-visible {
  color: #ff8c8c;
  border-bottom-color: #ff8c8c;
}

/* Main Menu */
#main-menu {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  z-index: 30;
  background:
    linear-gradient(rgba(0,0,0,0.42), rgba(0,0,0,0.42)),
    url('jouw-ski-landscape.jpg') center center / cover no-repeat;
  isolation: isolate;
  pointer-events: auto;
}

#main-menu::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0,0,0,0.05) 28%, rgba(0,0,0,0.72) 100%);
  pointer-events: none;
  z-index: 0;
}

.menu-sidebar,
.menu-main-content,
#menu-ad-left,
#menu-ad-right {
  position: relative;
  z-index: 1;
}

.menu-sidebar {
  width: 96px;
  min-width: 96px;
  height: 100%;
  border-right: 1px solid rgba(255,255,255,0.14);
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 12px;
}

.sidebar-nav {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 74px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-white);
  background: transparent;
  font-family: 'Bebas Neue', Arial, sans-serif;
  letter-spacing: 0.08em;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s ease, text-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.sidebar-item i {
  font-size: 20px;
}

.sidebar-item:hover,
.sidebar-item:focus-visible {
  color: var(--accent-gold);
  border-color: rgba(196,164,124,0.48);
  background: rgba(255,255,255,0.03);
  text-shadow: 0 0 14px rgba(196,164,124,0.68);
}

#main-menu .menu-btn.selected {
  color: var(--accent-gold);
  border-color: rgba(196,164,124,0.52);
  box-shadow: 0 0 0 2px rgba(196,164,124,0.14), inset 0 0 18px rgba(196,164,124,0.07);
}

.menu-main-content {
  flex: 1;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 30px clamp(20px, 4vw, 56px);
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(15px);
}

.menu-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.menu-top-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 2.2vw, 32px);
}

.menu-link,
.hero-link {
  appearance: none;
  border: none;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.9);
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  font-size: clamp(13px, 1.4vw, 17px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 0;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.menu-link:hover,
.menu-link:focus-visible,
.hero-link:hover,
.hero-link:focus-visible {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.menu-hero {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  color: var(--text-white);
}

.game-title {
  margin: 0;
  font-family: 'Bebas Neue', Arial, sans-serif;
  font-size: clamp(70px, 11vw, 170px);
  letter-spacing: 0.14em;
  color: var(--text-white);
  line-height: 0.94;
  text-shadow: 0 0 22px rgba(0,0,0,0.6);
}

.menu-tagline {
  margin: 0;
  max-width: 760px;
  font-size: clamp(16px, 1.7vw, 22px);
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.05em;
}

.menu-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  margin-top: 8px;
  color: rgba(255,255,255,0.92);
  font-size: 15px;
  letter-spacing: 0.05em;
}

.menu-controller-hint {
  color: rgba(255,255,255,0.65);
}

.menu-name-row {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-name-row label {
  color: rgba(255,255,255,0.84);
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  letter-spacing: 0.08em;
}

.menu-name-row input {
  width: min(320px, 72vw);
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  background: rgba(0,0,0,0.35);
  color: #fff;
  outline: none;
}

.menu-name-row input:focus {
  border-color: rgba(196,164,124,0.75);
  box-shadow: 0 0 0 2px rgba(196,164,124,0.2);
}

.location-widget {
  position: absolute;
  left: clamp(18px, 3vw, 42px);
  bottom: clamp(20px, 3vw, 34px);
  width: min(340px, 78vw);
  padding: 14px 16px;
  border: 1px solid rgba(196,164,124,0.85);
  border-radius: 10px;
  background: rgba(8,8,8,0.46);
  color: #fff;
  text-align: left;
}

.location-widget h2 {
  margin: 0 0 8px 0;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-gold);
}

.location-widget p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.location-highlight {
  box-shadow: 0 0 0 2px rgba(196,164,124,0.45), 0 0 30px rgba(196,164,124,0.28);
}

.hero-actions {
  position: static;
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 28px;
}

.menu-anim-item {
  opacity: 0;
  transform: translateY(12px);
  animation: menuSlideIn 0.65s ease forwards;
}

.sidebar-nav .menu-anim-item:nth-child(1) { animation-delay: 0.08s; }
.sidebar-nav .menu-anim-item:nth-child(2) { animation-delay: 0.15s; }
.sidebar-nav .menu-anim-item:nth-child(3) { animation-delay: 0.22s; }
.sidebar-nav .menu-anim-item:nth-child(4) { animation-delay: 0.29s; }
.sidebar-nav .menu-anim-item:nth-child(5) { animation-delay: 0.36s; }
.menu-topbar.menu-anim-item { animation-delay: 0.22s; }
.menu-hero .menu-anim-item:nth-child(1) { animation-delay: 0.35s; }
.menu-hero .menu-anim-item:nth-child(2) { animation-delay: 0.44s; }
.menu-hero .menu-anim-item:nth-child(3) { animation-delay: 0.53s; }
.menu-hero .menu-anim-item:nth-child(4) { animation-delay: 0.62s; }
.menu-hero .menu-anim-item:nth-child(5) { animation-delay: 0.7s; }
.location-widget.menu-anim-item { animation-delay: 0.82s; }

@keyframes menuSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  #main-menu {
    flex-direction: column;
  }

  .menu-sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.14);
    padding: 10px 12px;
  }

  .sidebar-nav {
    flex-direction: row;
    justify-content: space-between;
  }

  .sidebar-item {
    min-height: 58px;
    padding: 8px 4px;
    font-size: 15px;
    gap: 5px;
  }

  .menu-main-content {
    padding: 20px 16px 28px 16px;
  }

  .location-widget {
    position: static;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .menu-top-links {
    gap: 10px 14px;
  }

  .menu-link,
  .hero-link {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .game-title {
    font-size: clamp(54px, 17vw, 100px);
  }

  .menu-tagline {
    font-size: 14px;
  }

  .menu-stats {
    font-size: 13px;
    gap: 6px 14px;
  }

  .hero-actions {
    position: static;
    margin-top: 10px;
    justify-content: center;
  }
}

#skin-shop .menu-btn,
#location-view .menu-btn,
#leaderboard-view .menu-btn,
#settings-view .menu-btn,
#overlay .menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  margin-top: 14px;
  padding: 10px 4px;
  font-size: 14px;
  letter-spacing: 0.12em;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  color: rgba(255,255,255,0.95);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(196,164,124,0.45);
  border-radius: 0;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  box-shadow: none;
}

#skin-shop .menu-btn:hover,
#location-view .menu-btn:hover,
#leaderboard-view .menu-btn:hover,
#settings-view .menu-btn:hover,
#overlay .menu-btn:hover {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  font-size: 13px;
  letter-spacing: 0.1em;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  color: rgba(255,255,255,0.92);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.22);
  border-radius: 0;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  flex: 1;
}

.tab-btn:hover {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.tab-btn.active {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
  outline: none;
  box-shadow: none;
}

.tab-btn:active {
  transform: none;
}

/* Skin Shop */
#skin-shop {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(15px);
}

/* Location View */
#location-view {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(15px);
}

/* Leaderboard View */
#leaderboard-view {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(15px);
}

/* Settings View */
#settings-view {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(15px);
}

#skin-shop::before,
#location-view::before,
#leaderboard-view::before,
#settings-view::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(0,0,0,0.08) 28%, rgba(0,0,0,0.68) 100%);
  pointer-events: none;
}

.shop-content {
  position: relative;
  z-index: 1;
  width: min(960px, 92vw);
  background: rgba(10, 10, 10, 0.7);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.42);
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
}

.shop-content h2 {
  margin: 0 0 20px 0;
  font-size: clamp(34px, 6vw, 56px);
  letter-spacing: 0.12em;
  font-family: 'Bebas Neue', Arial, sans-serif;
  color: var(--text-white);
  text-align: center;
}

.shop-balance {
  text-align: center;
  font-size: 22px;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  color: rgba(255,255,255,0.92);
  margin-bottom: 30px;
}

#leaderboard-view .leaderboard-list,
#leaderboard-view .leaderboard-list > div,
#leaderboard-view .leaderboard-list span {
  color: rgba(255,255,255,0.96);
}

.skins-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 900px) {
  .skins-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .skins-grid {
    grid-template-columns: 1fr;
  }
}

.skin-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.skin-item.selected {
  outline: 2px solid rgba(196,164,124,0.48);
  box-shadow: 0 0 0 2px rgba(196,164,124,0.16);
  transform: translateY(-4px);
}

.skin-item:hover {
  transform: translateY(-4px);
  border-color: rgba(196,164,124,0.56);
}

.location-item.locked {
  opacity: 0.55;
  border-color: rgba(255,255,255,0.08);
}

.location-item.locked:hover {
  transform: none;
  border-color: rgba(255,255,255,0.08);
}

.skin-preview {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}

.skin-name {
  font-size: 18px;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  color: var(--text-white);
  margin-bottom: 8px;
}

.skin-price {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 12px;
}

.location-map-details {
  font-size: 12px;
  color: rgba(255,255,255,0.76);
  line-height: 1.4;
  margin-bottom: 12px;
}

.skin-btn {
  width: 100%;
  padding: 10px 4px;
  font-size: 13px;
  letter-spacing: 0.09em;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.28);
  border-radius: 0;
  background: transparent;
  color: rgba(255,255,255,0.95);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.skin-btn:not(.owned):not(.equipped) {
  color: rgba(255,255,255,0.95);
}

.skin-btn:not(.owned):not(.equipped):hover {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.skin-btn.owned:not(.equipped) {
  color: var(--accent-gold);
  border-bottom-color: rgba(196,164,124,0.7);
}

.skin-btn.equipped {
  color: rgba(255,255,255,0.58);
  border-bottom-color: rgba(255,255,255,0.15);
  cursor: default;
}

.skin-btn:disabled {
  color: rgba(255,255,255,0.45);
  border-bottom-color: rgba(255,255,255,0.15);
  cursor: not-allowed;
}

.settings-row {
  margin: 18px 0;
}

.settings-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.9);
  font-size: 1.02em;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  letter-spacing: 0.05em;
}

.settings-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-percent {
  min-width: 44px;
  color: rgba(255,255,255,0.78);
}

/* Background blur when menu open */
body.menu-open canvas {
  filter: blur(5px);
}

/* ===== AD SYSTEM STYLES ===== */

/* Ad Continue Button */
#ad-continue-btn {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  margin: 0;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: bold;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: 3px solid #fff;
  border-radius: 10px;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  font-family: Arial, sans-serif;
  width: 100%;
  max-width: 280px;
}

#ad-continue-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

#ad-continue-btn:active {
  transform: translateY(0);
}

/* Ad Container (Full-screen ad viewer) */
#ad-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  font-family: Arial, sans-serif;
}

#ad-container h2 {
  font-size: 28px;
  margin-bottom: 30px;
  color: #667eea;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#ad-space {
  width: 90vw;
  max-width: 980px;
  min-height: 250px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  margin: 20px auto;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 18px;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Ensure AdSense responsive ins fills container */
.adsbygoogle {
  display: block !important;
  width: 100% !important;
  height: auto !important;
}

/* Hide any automatic AdSense blocks injected outside the overlay
   Keep our overlay ad (id="ad-space") visible. This removes
   corner/anchor ads that can block the canvas. */
ins.adsbygoogle:not(#ad-space) {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

#ad-timer {
  font-size: 20px;
  margin-top: 30px;
  color: #ffd700;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#skip-ad-btn {
  margin-top: 30px;
  padding: 10px 30px;
  font-size: 16px;
  background: #444;
  color: white;
  border: 2px solid #666;
  border-radius: 5px;
  cursor: not-allowed;
  opacity: 0.5;
  transition: all 0.3s ease;
  font-weight: bold;
}

#skip-ad-btn:not(:disabled) {
  background: #667eea;
  border-color: #667eea;
  cursor: pointer;
  opacity: 1;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#skip-ad-btn:not(:disabled):hover {
  background: #764ba2;
  border-color: #764ba2;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

#skip-ad-btn:not(:disabled):active {
  transform: translateY(0);
}

/* Lobby UI Styles */
.lobby-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0 6px;
}

.lobby-menu-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.lobby-option {
  background: rgba(255,255,255,0.03);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(196,164,124,0.08);
}

.lobby-option h3 {
  margin: 0;
  color: rgba(255,255,255,0.96);
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lobby-option p {
  margin: 12px 0 16px;
  color: rgba(255,255,255,0.72);
  font-size: 14px;
  line-height: 1.45;
}

.lobby-btn {
  width: 100%;
  background: transparent;
  color: rgba(255,255,255,0.96);
  border: none;
  border-bottom: 1px solid rgba(196,164,124,0.52);
  padding: 10px 4px;
  margin: 8px 0 0;
  border-radius: 0;
  cursor: pointer;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.lobby-btn:hover {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.lobby-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  color: rgba(255,255,255,0.6);
  border-bottom-color: rgba(255,255,255,0.2);
}

.lobby-btn.secondary {
  color: rgba(255,255,255,0.78);
  border-bottom-color: rgba(255,255,255,0.35);
}

.lobby-btn.secondary:hover {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.lobby-btn-compact {
  width: auto;
  min-width: 160px;
  display: inline-flex;
  justify-content: center;
  margin-top: 0;
}

.lobby-content {
  text-align: center;
  padding: 12px 0;
}

.channel-key {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 14px;
  border-radius: 10px;
  margin: 15px 0;
}

.channel-key label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 12px;
}

.channel-key code {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-gold);
  margin: 10px 0;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
}

.copy-btn {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.35);
  padding: 6px 2px;
  border-radius: 0;
  cursor: pointer;
  margin-top: 10px;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-btn:hover {
  color: var(--accent-gold);
  border-bottom-color: var(--accent-gold);
}

.player-list {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 15px;
  border-radius: 10px;
  margin: 15px 0;
  text-align: left;
}

.player-list h3 {
  margin-top: 0;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'Cinzel', 'Trebuchet MS', sans-serif;
  font-size: 13px;
}

.player-list p {
  margin: 7px 0;
  color: rgba(255,255,255,0.84);
}

.lobby-input {
  width: 100%;
  padding: 12px;
  margin: 10px 0 4px;
  font-size: 16px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  background: rgba(0,0,0,0.35);
  color: #fff;
  text-transform: uppercase;
}

.lobby-input:focus {
  outline: none;
  border-color: rgba(196,164,124,0.78);
  box-shadow: 0 0 0 2px rgba(196,164,124,0.2);
}

.lobby-input::placeholder {
  color: rgba(255,255,255,0.45);
}

.spinner {
  border: 3px solid rgba(255,255,255,0.2);
  border-top: 3px solid var(--accent-gold);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.opponent-label {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 11px;
  transform: translate(-50%, -130%);
}

.waiting-message {
  color: rgba(255,255,255,0.68);
  font-style: italic;
  margin: 20px 0;
}

.player-count {
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  margin: 15px 0;
}

#content-section.multiplayer-content {
  width: min(760px, 92vw);
  max-width: 760px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(10, 10, 10, 0.86);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.94);
  backdrop-filter: blur(14px);
}

#content-section.multiplayer-content h2 {
  margin: 0 0 8px;
  border-bottom: 1px solid rgba(196,164,124,0.48);
  color: #fff;
  font-family: 'Bebas Neue', Arial, sans-serif;
  font-size: clamp(42px, 6vw, 58px);
  letter-spacing: 0.08em;
  line-height: 0.96;
}

#content-section.multiplayer-content p,
#content-section.multiplayer-content label {
  color: rgba(255,255,255,0.84);
}

.lobby-status-text {
  font-size: 12px;
  color: rgba(255,255,255,0.58);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lobby-offline-warning {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(196,164,124,0.65);
  background: rgba(196,164,124,0.14);
  color: rgba(255,255,255,0.86);
  font-size: 13px;
  line-height: 1.45;
}

.lobby-empty-state {
  margin: 8px 0;
  color: rgba(255,255,255,0.6);
}

.lobby-player-row {
  padding-left: 8px;
  border-left: 2px solid transparent;
}

.lobby-player-row.is-ready {
  border-left-color: rgba(67, 190, 120, 0.8);
}

.lobby-player-row.is-not-ready {
  border-left-color: rgba(255,255,255,0.2);
}

@media (max-width: 760px) {
  .lobby-menu {
    grid-template-columns: 1fr;
  }

  #content-section.multiplayer-content {
    padding: 20px;
  }

  #content-section.multiplayer-content h2 {
    font-size: clamp(34px, 10vw, 48px);
  }
}