*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  font-family:"Space Grotesk",sans-serif;
}

html,
body{
  width:100%;
  min-height:100%;
  overflow-x:hidden;
  background:radial-gradient(circle at top,#31235c 0%,#10091f 48%,#040208 100%);
  color:white;
}

body{
  min-height:100vh;
}

button,
a{
  font-family:inherit;
}

.game-shell{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.top-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:16px 22px;
  background:rgba(0,0,0,.38);
  border-bottom:1px solid rgba(255,255,255,.1);
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter:blur(14px);
}

.top-left{
  display:flex;
  align-items:center;
  gap:28px;
  flex:1;
}

.title-wrap h1{
  font-size:clamp(1.35rem,3vw,2.45rem);
  letter-spacing:.1em;
}

.subtitle{
  opacity:.74;
  margin-top:6px;
}

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

.top-btn{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:white;
  text-decoration:none;
  border:none;
  cursor:pointer;
  padding:12px 20px;
  border-radius:999px;
  font-size:1.05rem;
  font-weight:900;
  background:linear-gradient(180deg,rgba(255,255,255,.18),rgba(255,255,255,.07));
  box-shadow:0 10px 24px rgba(0,0,0,.25);
}

.hud{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  padding:16px 22px 0;
}

.hud-card{
  padding:14px;
  border-radius:18px;
  background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.05));
  border:1px solid rgba(255,255,255,.1);
}

.hud-label{
  opacity:.72;
  margin-bottom:6px;
  font-size:.85rem;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.hud-value{
  font-size:1.12rem;
  font-weight:900;
}

.game-area{
  flex:1;
  display:grid;
  grid-template-columns:minmax(320px,1fr) 310px;
  gap:24px;
  padding:24px 24px 100px;
  align-items:start;
}

.board-panel{
  display:flex;
  justify-content:center;
}

.checker-board{
  width:min(76vw,720px);
  aspect-ratio:1;
  position:relative;
  border-radius:32px;
  background:
    radial-gradient(circle at 50% 10%,rgba(255,255,255,.18),transparent 34%),
    linear-gradient(135deg,#6138a8,#201146 58%,#0b0618);
  border:1px solid rgba(255,255,255,.18);
  box-shadow:
    0 30px 80px rgba(0,0,0,.58),
    inset 0 0 0 12px rgba(255,255,255,.035),
    inset 0 0 45px rgba(255,255,255,.08);
  overflow:hidden;
}

.board-spot{
  position:absolute;
  width:5.6%;
  aspect-ratio:1;
  border:none;
  border-radius:50%;
  transform:translate(-50%,-50%);
  background:
    radial-gradient(circle at 35% 25%,rgba(255,255,255,.35),rgba(255,255,255,.08));
  border:1px solid rgba(255,255,255,.22);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.board-spot.legal{
  box-shadow:
    0 0 0 3px rgba(255,232,128,.8),
    0 0 22px rgba(255,232,128,.65);
}

.board-spot.selected{
  box-shadow:
    0 0 0 4px rgba(255,255,255,.9),
    0 0 24px rgba(255,255,255,.55);
}

.marble{
  width:88%;
  aspect-ratio:1;
  border-radius:50%;
  box-shadow:
    inset 0 6px 9px rgba(255,255,255,.25),
    inset 0 -8px 14px rgba(0,0,0,.35),
    0 8px 14px rgba(0,0,0,.38);
}

.marble.player{
  background:radial-gradient(circle at 35% 25%,#ff9b9b,#e92929 56%,#6b0707);
}

.marble.ai{
  background:radial-gradient(circle at 35% 25%,#9bd0ff,#267bff 56%,#07326e);
}

.side-panel{
  display:flex;
  flex-direction:column;
  gap:16px;
  position:sticky;
  top:106px;
}

.action-btn{
  border:none;
  border-radius:20px;
  padding:17px;
  cursor:pointer;
  font-size:1.05rem;
  font-weight:900;
  color:#11091f;
  background:linear-gradient(180deg,#ffe28f,#ffb92f);
}

.status-box,
.legend{
  padding:17px;
  border-radius:20px;
  background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.045));
  border:1px solid rgba(255,255,255,.1);
  line-height:1.55;
  font-weight:800;
}

.legend{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.mini-marble{
  width:18px;
  height:18px;
  display:inline-block;
  border-radius:50%;
  margin-right:8px;
  vertical-align:-3px;
}

.mini-marble.player{
  background:#e92929;
}

.mini-marble.ai{
  background:#267bff;
}

.instructions-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.78);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:999;
}

.hidden{
  display:none;
}

.instructions-modal{
  width:min(94vw,780px);
  max-height:86vh;
  overflow:auto;
  border-radius:28px;
  background:#120a28;
  border:1px solid rgba(255,255,255,.12);
  padding:28px;
  position:relative;
}

.instructions-content{
  display:flex;
  flex-direction:column;
  gap:18px;
  line-height:1.7;
}

.instructions-content ul{
  padding-left:24px;
}

.close-btn{
  position:absolute;
  top:18px;
  right:18px;
  width:42px;
  height:42px;
  border:none;
  border-radius:50%;
  font-weight:900;
  cursor:pointer;
}

@media (max-width:1000px){
  .game-area{
    grid-template-columns:1fr;
  }

  .side-panel{
    position:relative;
    top:auto;
  }

  .checker-board{
    width:min(94vw,720px);
  }
}

@media (max-width:680px){
  .top-bar{
    flex-direction:column;
    align-items:flex-start;
  }

  .top-left{
    width:100%;
    gap:16px;
  }

  .title-wrap h1{
    font-size:1.25rem;
  }

  .top-actions,
  .top-btn{
    width:100%;
  }

  .hud{
    grid-template-columns:1fr;
    padding:14px 14px 0;
  }

  .game-area{
    padding:14px 14px 90px;
  }

  .checker-board{
    width:94vw;
    border-radius:22px;
  }

  .board-spot{
    width:6.8%;
  }
}

html,
body{
  background:
    radial-gradient(circle at top,#5a2f13 0%,#2b1207 52%,#090301 100%) !important;
}

.checker-board{
  background:
    radial-gradient(circle at 50% 35%,rgba(255,231,170,.28),transparent 42%),
    repeating-linear-gradient(
      90deg,
      rgba(120,64,24,.22) 0 18px,
      rgba(255,210,135,.08) 18px 36px
    ),
    linear-gradient(135deg,#d89a4a,#9b5d24 48%,#5a2e12) !important;
  border:5px solid #6b3514 !important;
  box-shadow:
    0 30px 80px rgba(0,0,0,.58),
    inset 0 0 0 12px rgba(70,32,10,.45),
    inset 0 0 45px rgba(255,231,170,.22) !important;
}

.board-spot{
  background:
    radial-gradient(circle at 35% 25%,#3b1608,#170702 68%) !important;
  border:2px solid rgba(255,214,135,.5) !important;
  box-shadow:
    inset 0 4px 8px rgba(0,0,0,.65),
    0 2px 5px rgba(255,232,160,.18) !important;
}

.board-spot.legal{
  background:
    radial-gradient(circle at 35% 25%,#ffe28f,#9c651e 65%) !important;
  box-shadow:
    0 0 0 3px rgba(255,226,143,.85),
    0 0 22px rgba(255,226,143,.65) !important;
}

.marble.player{
  background:
    radial-gradient(circle at 35% 25%,#ffd0d0,#c91818 58%,#5b0505) !important;
}

.marble.ai{
  background:
    radial-gradient(circle at 35% 25%,#fff2b4,#d8a326 58%,#744900) !important;
}

.top-bar,
.hud-card,
.status-box,
.legend,
.instructions-modal{
  background:
    linear-gradient(180deg,rgba(92,45,18,.92),rgba(35,15,6,.92)) !important;
  border-color:rgba(255,214,135,.22) !important;
}

.action-btn,
.top-btn{
  background:
    linear-gradient(180deg,#ffe08a,#c47a21) !important;
  color:#1b0b03 !important;
}

.title-wrap h1,
.subtitle,
.hud-value,
.hud-label,
.status-box,
.legend{
  color:#fff3d6 !important;
}

.hud{
  grid-template-columns:1fr !important;
}

.game-area{
  display:block !important;
  padding:18px 18px 120px !important;
}

.board-panel{
  width:100% !important;
}

.checker-board{
  width:min(96vw,980px) !important;
  margin:0 auto !important;
}

.side-panel{
  display:none !important;
}

.board-spot{
  width:4.2% !important;
}

.top-actions{
  gap:12px !important;
}

@media (max-width:680px){
  .checker-board{
    width:96vw !important;
  }

  .board-spot{
    width:4.9% !important;
  }
}

.checker-board{
  width:min(88vw,640px) !important;
  max-width:640px !important;
  margin:0 auto !important;
  overflow:visible !important;
}

.board-spot{
  width:3.45% !important;
  min-width:11px !important;
  max-width:23px !important;
}

.marble{
  width:86% !important;
}

@media (max-width:900px){
  .checker-board{
    width:min(92vw,600px) !important;
  }

  .board-spot{
    width:3.35% !important;
  }
}

@media (max-width:680px){
  .checker-board{
    width:94vw !important;
  }

  .board-spot{
    width:3.15% !important;
    min-width:8px !important;
  }

  .marble{
    width:84% !important;
  }
}

.marble.player-red,
.marble.red{
  background:radial-gradient(circle at 35% 25%,#ffd0d0,#c91818 58%,#5b0505) !important;
}

.marble.player-yellow,
.marble.yellow{
  background:radial-gradient(circle at 35% 25%,#fff3bc,#d5a214 58%,#7b5200) !important;
}

.marble.player-blue,
.marble.blue{
  background:radial-gradient(circle at 35% 25%,#d7ebff,#1f75ff 58%,#082c70) !important;
}

.marble.player-green,
.marble.green{
  background:radial-gradient(circle at 35% 25%,#d8ffd7,#1eaf47 58%,#08511d) !important;
}

.marble.player-purple,
.marble.purple{
  background:radial-gradient(circle at 35% 25%,#f0d7ff,#9141ff 58%,#3c1178) !important;
}

.marble.player-orange,
.marble.orange{
  background:radial-gradient(circle at 35% 25%,#ffe0bf,#ff8f1f 58%,#7a3c00) !important;
}

.board-spot .marble{
  display:block !important;
  height:auto !important;
  aspect-ratio:1 !important;
  border-radius:50% !important;
  opacity:1 !important;
  visibility:visible !important;
  z-index:5 !important;
}
