body{
  overflow:hidden;
  color:#f7e8c1;
  background:#02070d;
}
body:before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-3;
  background:
    radial-gradient(circle at 50% 34%,#0d2940 0,#061624 35%,#02070d 72%);
}
body:after{
  content:"";
  position:fixed;
  inset:0;
  z-index:-2;
  pointer-events:none;
  opacity:.55;
  background:
    radial-gradient(ellipse at 5% 80%,transparent 0 25%,#9a671c22 25.2% 25.5%,transparent 25.7%),
    radial-gradient(ellipse at 95% 80%,transparent 0 25%,#9a671c22 25.2% 25.5%,transparent 25.7%);
}
.app{
  height:100dvh;
  width:min(1160px,100%);
  margin:auto;
  padding:
    max(8px,env(safe-area-inset-top))
    clamp(10px,1.8vw,20px)
    max(10px,env(safe-area-inset-bottom));
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto auto;
  gap:clamp(5px,1vh,10px);
}
.topbar{
  min-height:34px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
}
.profile-link{
  min-height:31px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:6px 10px;
  border:1px solid #a87322;
  border-radius:8px;
  background:#07131e;
  color:#f4cd73;
  text-decoration:none;
  font-size:12px;
  font-weight:700;
  box-shadow:0 4px 15px #0008;
  white-space:nowrap;
}
.profile-link:hover{filter:brightness(1.08)}
.profile-link:active{transform:translateY(1px)}
.profile-icon{font-size:14px;line-height:1}
.profile-label{
  max-width:180px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.language{
  background:#07131e;
  color:#f4cd73;
  border:1px solid #a87322;
  border-radius:8px;
  padding:7px 10px;
  font-size:12px;
  cursor:pointer;
  outline:none;
  box-shadow:0 4px 15px #0008;
}
.hero{
  min-height:0;
  position:relative;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  justify-items:center;
  align-items:center;
}
.brand{
  z-index:4;
  text-align:center;
  white-space:nowrap;
}
.brand .crown{
  display:block;
  height:26px;
  font-size:31px;
  color:#f4cd73;
  line-height:22px;
}
.brand h1{
  margin:0;
  font-family:Georgia,serif;
  font-size:clamp(34px,5.4vh,58px);
  letter-spacing:4px;
  color:#f4cd73;
  text-shadow:0 3px 10px #000;
}
.brand p{
  margin:4px 0 0;
  font-size:clamp(10px,1.5vh,13px);
  letter-spacing:5px;
  color:#dcae4f;
  font-weight:700;
}
.brand p:before,.brand p:after{
  content:"◆";
  font-size:7px;
  margin:0 12px;
  color:#dcae4f;
}
.board-shell{
  align-self:center;
  width:min(43vh,470px,70vw);
  aspect-ratio:1;
  padding:5px;
  border:1px solid #b37a25;
  border-radius:16px;
  background:#06131e;
  box-shadow:0 18px 55px #0009;
  opacity:.42;
  filter:saturate(.9);
  transform:perspective(900px) rotateX(3deg);
  mask-image:linear-gradient(to bottom,transparent 0,#000 8%,#000 86%,transparent 100%);
  -webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 8%,#000 86%,transparent 100%);
}
.board-watermark{
  width:100%;
  height:100%;
  display:grid;
  grid-template-columns:repeat(8,1fr);
  grid-template-rows:repeat(8,1fr);
  border:1px solid #c18a36;
  border-radius:4px;
  overflow:hidden;
}
.sq{display:flex;align-items:center;justify-content:center;position:relative}
.sq.light{background:#efd18f}
.sq.dark{background:#936036}
.sq img{
  width:94%;
  height:94%;
  object-fit:contain;
  display:block;
  z-index:2;
  filter:drop-shadow(0 4px 3px #0008);
  pointer-events:none;
}
.stats{
  z-index:4;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:clamp(18px,4vw,44px);
  color:#d8c69f;
  font-size:clamp(12px,1.8vh,16px);
  white-space:nowrap;
}
.stat{display:flex;align-items:center;gap:8px}
.stat strong{color:#f4cd73;font-size:1.18em}
.stat-icon{color:#dcae4f}
.menu{
  width:min(760px,100%);
  margin:auto;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(7px,1.1vh,11px) clamp(8px,1.2vw,14px);
}
.legal-footer{
  min-height:14px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:2px 7px;
  text-align:center;
}
.legal-footer a{
  color:#bda97d;
  font-size:10px;
  line-height:1.2;
  text-decoration:none;
}
.legal-footer a:hover{
  color:#f4cd73;
  text-decoration:underline;
}
.legal-footer a:focus-visible{
  outline:2px solid #2b86ff;
  outline-offset:2px;
  border-radius:3px;
}
.menu-btn{
  text-decoration:none;
  min-height:clamp(48px,6.7vh,66px);
  border:1px solid #a87322;
  border-radius:12px;
  background:linear-gradient(90deg,#07131e,#0b1925);
  color:#f7e8c1;
  display:flex;
  align-items:center;
  gap:clamp(9px,1.2vw,13px);
  padding:clamp(7px,1vh,11px) clamp(11px,1.5vw,16px);
  box-shadow:0 7px 18px #0007,inset 0 1px #ffffff0a;
  font-size:clamp(14px,2vh,19px);
  font-weight:700;
  text-align:left;
  cursor:default;
  user-select:none;
}
a.menu-btn{cursor:pointer}
a.menu-btn:hover{filter:brightness(1.08)}
a.menu-btn:active{transform:translateY(1px)}
.menu-btn.primary{
  border-color:#2b86ff;
  background:linear-gradient(#1467d8,#0750b4);
  box-shadow:0 5px 15px #003c9970;
}
.menu-btn.alt{
  background:linear-gradient(90deg,#091722,#0d2433);
  border-color:#8d641e;
}
.menu-icon{
  width:clamp(34px,4.7vh,42px);
  height:clamp(34px,4.7vh,42px);
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #bd8129;
  border-radius:10px;
  background:#07111a;
  color:#f4cd73;
  font-size:clamp(18px,2.8vh,25px);
}
.menu-btn.primary .menu-icon{
  border-color:#ffffff55;
  color:#fff;
  background:#06131e88;
}
.menu-text{min-width:0;line-height:1.08}
.badge{
  margin-left:auto;
  color:#7f96a6;
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}
#settingsButton{cursor:pointer}
#settingsButton:hover{filter:brightness(1.08)}
#settingsButton:active{transform:translateY(1px)}
.theme-modal[hidden]{display:none}
.theme-modal{
  position:fixed;
  inset:0;
  z-index:50;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:#000a;
  backdrop-filter:blur(5px);
}
.theme-panel{
  position:relative;
  width:min(430px,94vw);
  border:1px solid #a87322;
  border-radius:18px;
  padding:24px;
  background:linear-gradient(180deg,#0b1b29,#07131e);
  color:#f7e8c1;
  box-shadow:0 24px 70px #000c;
}
.theme-panel h2{
  margin:0 42px 20px;
  color:#f4cd73;
  font-family:Georgia,serif;
  font-size:26px;
  text-align:center;
}
.settings-label{
  margin:0 0 9px;
  color:#9eb0bd;
  font-size:12px;
  font-weight:800;
  letter-spacing:.7px;
  text-transform:uppercase;
}
.theme-close{
  position:absolute;
  top:12px;
  right:14px;
  width:36px;
  height:36px;
  border:0;
  background:transparent;
  color:#d8c69f;
  font-size:30px;
  line-height:1;
  cursor:pointer;
}
.theme-options{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.theme-choice{
  min-height:112px;
  border:1px solid #5e7382;
  border-radius:14px;
  background:#091824;
  color:#d8c69f;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:17px;
  font-weight:800;
  cursor:pointer;
}
.theme-choice-icon{font-size:34px;line-height:1}
.theme-choice.active{
  border-color:#2b86ff;
  background:linear-gradient(#1467d8,#0750b4);
  color:#fff;
  box-shadow:0 5px 15px #003c9970;
}
.sound-choice{
  width:100%;
  min-height:62px;
  margin-top:14px;
  padding:10px 14px;
  border:1px solid #5e7382;
  border-radius:14px;
  background:#091824;
  color:#d8c69f;
  display:flex;
  align-items:center;
  gap:11px;
  font-size:16px;
  font-weight:800;
  cursor:pointer;
}
.sound-choice-icon{
  width:36px;
  height:36px;
  flex:0 0 36px;
  border:1px solid #6d8290;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:22px;
}
.sound-state{
  margin-left:auto;
  color:#91a3af;
  font-size:13px;
}
.sound-switch{
  position:relative;
  width:54px;
  height:30px;
  flex:0 0 54px;
  border:1px solid #6d8290;
  border-radius:999px;
  background:#465763;
  box-shadow:inset 0 2px 5px #0005;
  transition:background .2s,border-color .2s;
}
.sound-switch-knob{
  position:absolute;
  top:3px;
  left:3px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 6px #0008;
  transition:transform .2s;
}
.sound-choice.active .sound-switch{
  border-color:#56cb79;
  background:#25a84f;
}
.sound-choice.active .sound-switch-knob{
  transform:translateX(24px);
}
.sound-choice.active{
  border-color:#2b86ff;
  background:#0d2940;
  color:#fff;
}
.sound-choice.active .sound-choice-icon{
  border-color:#4f9cff;
  background:#1467d8;
}
.sound-choice.active .sound-state{
  color:#74d995;
}
html[data-theme="light"] body{
  color:#25384a;
  background:#eadfcd;
}
html[data-theme="light"] body:before{
  background:radial-gradient(circle at 50% 34%,#fffdf8 0,#f3eadc 42%,#dfcfb7 100%);
}
html[data-theme="light"] body:after{
  opacity:.32;
  background:
    radial-gradient(ellipse at 5% 80%,transparent 0 25%,#9a671c33 25.2% 25.5%,transparent 25.7%),
    radial-gradient(ellipse at 95% 80%,transparent 0 25%,#9a671c33 25.2% 25.5%,transparent 25.7%);
}
html[data-theme="light"] .profile-link,
html[data-theme="light"] .language{
  border-color:#b7812d;
  background:#fffaf1;
  color:#8a5b12;
  box-shadow:0 4px 14px #72522a24;
}
html[data-theme="light"] .brand .crown,
html[data-theme="light"] .brand h1{
  color:#9b670f;
  text-shadow:0 2px 8px #ffffffa8;
}
html[data-theme="light"] .brand p,
html[data-theme="light"] .brand p:before,
html[data-theme="light"] .brand p:after,
html[data-theme="light"] .stat-icon{
  color:#a36c12;
}
html[data-theme="light"] .board-shell{
  border-color:#b7812d;
  background:#fff7e9;
  box-shadow:0 18px 46px #6d4c2638;
  opacity:.54;
}
html[data-theme="light"] .stats{color:#5f5549}
html[data-theme="light"] .stat strong{color:#8d5e12}
html[data-theme="light"] .menu-btn.alt{
  border-color:#b7812d;
  background:linear-gradient(90deg,#fffaf2,#f3e7d5);
  color:#26394b;
  box-shadow:0 7px 18px #72522a24,inset 0 1px #fff;
}
html[data-theme="light"] .menu-btn.alt .menu-icon{
  border-color:#c18a36;
  background:#fffdf8;
  color:#96620e;
}
html[data-theme="light"] .badge{color:#6d7c87}
html[data-theme="light"] .legal-footer a{color:#76551f}
html[data-theme="light"] .legal-footer a:hover{color:#8f5e0d}
html[data-theme="light"] .theme-modal{background:#3e332a70}
html[data-theme="light"] .theme-panel{
  border-color:#b7812d;
  background:linear-gradient(180deg,#fffdf8,#f1e5d3);
  color:#25384a;
  box-shadow:0 24px 70px #5a402c55;
}
html[data-theme="light"] .theme-panel h2{color:#8f5e0d}
html[data-theme="light"] .theme-close{color:#5e5145}
html[data-theme="light"] .theme-choice{
  border-color:#bcae9b;
  background:#fffaf2;
  color:#34495a;
}
html[data-theme="light"] .theme-choice.active{
  border-color:#2b86ff;
  background:linear-gradient(#1467d8,#0750b4);
  color:#fff;
}
html[data-theme="light"] .settings-label{color:#6d7c87}
html[data-theme="light"] .sound-choice{
  border-color:#bcae9b;
  background:#fffaf2;
  color:#34495a;
}
html[data-theme="light"] .sound-choice-icon{
  border-color:#c6b79f;
  background:#fffdf8;
  color:#96620e;
}
html[data-theme="light"] .sound-state{color:#6d7c87}
html[data-theme="light"] .sound-switch{
  border-color:#aa9f90;
  background:#c8c0b4;
  box-shadow:inset 0 2px 5px #6f625533;
}
html[data-theme="light"] .sound-choice.active .sound-switch{
  border-color:#34a85a;
  background:#2dbd5c;
}
html[data-theme="light"] .sound-choice.active{
  border-color:#2b86ff;
  background:#eaf4ff;
  color:#26394b;
}
html[data-theme="light"] .sound-choice.active .sound-choice-icon{
  border-color:#2b86ff;
  background:#1467d8;
  color:#fff;
}
html[data-theme="light"] .sound-choice.active .sound-state{color:#168543}
@media(max-width:430px){
  .theme-panel{padding:20px 14px}
  .theme-panel h2{font-size:23px}
  .theme-choice{min-height:98px;font-size:15px}
}
@media(min-width:900px){
  .hero{
    grid-template-columns:minmax(300px,.9fr) minmax(360px,1.15fr);
    grid-template-rows:auto 1fr auto;
    column-gap:34px;
  }
  .brand{
    grid-column:1;
    grid-row:1 / span 2;
    align-self:center;
    transform:translateY(-4vh);
  }
  .board-shell{
    grid-column:2;
    grid-row:1 / span 3;
  }
  .stats{
    grid-column:1;
    grid-row:3;
    align-self:end;
    flex-direction:column;
    gap:5px;
    padding-bottom:4px;
  }
}
@media(max-height:720px){
  .app{gap:4px}
  .topbar{min-height:28px}
  .brand .crown{height:19px;font-size:25px;line-height:18px}
  .brand h1{font-size:32px}
  .brand p{font-size:9px;margin-top:1px}
  .board-shell{width:min(37vh,320px,58vw)}
  .menu-btn{min-height:45px;padding-top:6px;padding-bottom:6px}
  .menu-icon{width:30px;height:30px;font-size:18px}
  .stats{font-size:11px}
}
@media(max-height:590px){
  .brand .crown{display:none}
  .board-shell{width:min(29vh,205px,44vw)}
  .stats{display:none}
  .menu{gap:5px 7px}
  .menu-btn{min-height:39px;font-size:12px;border-radius:9px;padding:4px 9px}
  .menu-icon{width:27px;height:27px;font-size:16px;border-radius:8px}
}
@media(max-width:430px){
  .app{padding-left:8px;padding-right:8px}
  .brand h1{letter-spacing:3px}
  .brand p{letter-spacing:3px}
  .menu-btn{font-size:clamp(12px,3.8vw,16px);padding-left:8px;padding-right:8px}
  .menu-icon{width:31px;height:31px;font-size:18px}
  .badge{display:none}
}

