:root{
  --ink:#070707;
  --paper:#f4f2ec;
  --panel:#fffdf7;
  --line:#171717;
  --red:#e30613;
  --pink:#ff33b5;
  --yellow:#ffd51e;
  --blue:#1d8cff;
  --green:#77e03c;
  --muted:#696969;
  color-scheme:dark;
}
*{box-sizing:border-box}
html,body{min-height:100%;margin:0}
body{
  font-family:Arial, Helvetica, sans-serif;
  background:#050505;
  color:white;
  overflow-x:clip;
}
button,input{font:inherit}
button{touch-action:manipulation}
.game-app{
  min-height:100dvh;
  height:100dvh;
  display:grid;
  place-items:center;
  padding:10px;
  overflow:hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(227,6,19,.35), transparent 28%),
    radial-gradient(circle at 84% 8%, rgba(255,51,181,.28), transparent 24%),
    linear-gradient(180deg, #111 0%, #050505 100%);
}
.game-frame{
  width:min(1180px,100%);
  height:calc(100dvh - 20px);
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:8px;
}
.rotate-notice{
  display:none;
}
.game-top,.controls-bar{
  border:2px solid white;
  background:rgba(5,5,5,.86);
  box-shadow:0 0 0 2px #000;
}
.game-top{
  position:relative;
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px;
}
.brand{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:white;
  text-decoration:none;
  text-transform:uppercase;
  font-size:14px;
  font-weight:900;
  letter-spacing:0;
  white-space:nowrap;
}
.brand-mark{
  width:26px;
  height:26px;
  border:3px solid white;
  border-radius:50%;
  background:var(--red);
  position:relative;
  flex:0 0 auto;
}
.brand-mark:after{
  content:"";
  position:absolute;
  inset:5px;
  border:3px solid white;
  border-radius:50%;
}
.hud-strip{
  min-width:0;
  display:flex;
  justify-content:flex-end;
  gap:6px;
  flex-wrap:wrap;
}
.hud-strip span{
  min-height:30px;
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:0 8px;
  border:1px solid rgba(255,255,255,.4);
  background:#111;
  color:#cfcfcf;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
}
.hud-strip b{
  color:white;
  font-size:16px;
  line-height:1;
}
.canvas-wrap{
  position:relative;
  min-height:0;
  border:3px solid #000;
  background:#111;
  overflow:hidden;
  box-shadow:0 0 0 2px white;
}
canvas{
  display:block;
  width:100%;
  height:100%;
  min-height:420px;
  background:#15151d;
  touch-action:none;
}
.screen-panel{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(620px,calc(100% - 24px));
  max-height:calc(100% - 24px);
  overflow:auto;
  border:3px solid white;
  background:rgba(5,5,5,.94);
  padding:16px;
  box-shadow:8px 8px 0 #000;
}
.screen-panel.compact{width:min(460px,calc(100% - 24px))}
.screen-panel.hidden{display:none}
.eyebrow{
  margin:0 0 7px;
  color:var(--red);
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.1em;
}
h1,h2{
  margin:0;
  text-transform:uppercase;
  letter-spacing:0;
  line-height:.88;
}
h1{font-size:clamp(48px,12vw,96px)}
h2{font-size:clamp(34px,9vw,64px)}
.lede,.screen-panel p{
  color:#d0d0d0;
  font-size:14px;
  line-height:1.45;
}
.setup-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:14px 0;
}
.field{
  display:grid;
  gap:5px;
  color:#bdbdbd;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.field input{
  width:100%;
  min-height:42px;
  border:2px solid white;
  background:#111;
  color:white;
  padding:0 10px;
  font-size:15px;
  font-weight:700;
  text-transform:none;
  letter-spacing:0;
}
.sticker-picker,.active-stickers{
  display:flex;
  gap:8px;
  overflow-x:auto;
  scrollbar-width:thin;
}
.sticker-picker{
  padding:3px 0 12px;
}
.sticker-card,.sticker-chip{
  position:relative;
  flex:0 0 auto;
  width:72px;
  height:72px;
  border:2px dashed rgba(255,255,255,.45);
  background:#161616;
  display:grid;
  place-items:center;
  cursor:pointer;
  color:white;
}
.sticker-card.selected,.sticker-chip.active{
  border-style:solid;
  border-color:var(--yellow);
  box-shadow:0 0 0 3px #000, 0 0 0 5px var(--yellow);
}
.sticker-card canvas,.sticker-chip canvas{
  width:60px;
  height:60px;
}
.sticker-card small{
  position:absolute;
  right:3px;
  bottom:3px;
  background:#000;
  color:white;
  padding:2px 4px;
  font-size:9px;
  font-weight:900;
}
.panel-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}
.button,.control-button,.slap-button,.restart-button{
  min-height:42px;
  border:2px solid white;
  background:#111;
  color:white;
  padding:0 14px;
  font-size:13px;
  font-weight:900;
  text-transform:uppercase;
  cursor:pointer;
}
.button.primary,.slap-button{
  background:var(--red);
  border-color:var(--red);
}
.restart-button{
  min-height:30px;
  padding:0 10px;
  flex:0 0 auto;
  background:#050505;
  font-size:10px;
  box-shadow:3px 3px 0 #000;
}
.restart-button:active{
  transform:translate(2px,2px);
  box-shadow:1px 1px 0 #000;
}
.controls-bar{
  display:grid;
  grid-template-columns:48px 48px minmax(0,1fr) 68px;
  align-items:center;
  gap:9px;
  padding:7px 9px;
}
.control-button,.slap-button{
  position:relative;
  display:grid;
  place-items:center;
  aspect-ratio:1;
  border-radius:50%;
  padding:0;
  line-height:1;
  letter-spacing:0;
  box-shadow:0 5px 0 #000, inset 0 -7px 0 rgba(0,0,0,.35), inset 0 5px 0 rgba(255,255,255,.28);
}
.control-button:before,.slap-button:before{
  content:"";
  position:absolute;
  left:20%;
  top:13%;
  width:38%;
  height:20%;
  border-radius:50%;
  background:rgba(255,255,255,.35);
  transform:rotate(-18deg);
  pointer-events:none;
}
.control-button{
  width:48px;
  min-height:48px;
  background:linear-gradient(180deg,#333,#050505);
  border-color:#f4f4f4;
  font-size:9px;
}
.slap-button{
  width:68px;
  min-height:68px;
  background:radial-gradient(circle at 35% 25%, #ff7272, var(--red) 48%, #8d0008 100%);
  border-color:#fff;
  font-size:12px;
  color:white;
}
.control-button:active,.slap-button:active{
  transform:translateY(4px);
  box-shadow:0 1px 0 #000, inset 0 -5px 0 rgba(0,0,0,.35), inset 0 4px 0 rgba(255,255,255,.22);
}
.active-stickers{
  min-width:0;
  padding:4px;
  border:1px solid rgba(255,255,255,.25);
  background:#0c0c0c;
}
.sticker-chip{
  width:50px;
  height:50px;
}
.sticker-chip canvas{
  width:42px;
  height:42px;
}
.leaderboard{
  margin-top:12px;
  border:1px solid rgba(255,255,255,.35);
}
.leaderboard ol{
  margin:0;
  padding:0;
  list-style:none;
}
.leaderboard li{
  display:grid;
  grid-template-columns:32px 1fr auto;
  gap:8px;
  padding:7px 9px;
  border-top:1px solid rgba(255,255,255,.2);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}
.leaderboard li:first-child{border-top:0}
@media(max-width:720px){
  .game-app{padding:0}
  .game-frame{width:100%;height:100dvh;min-height:0;gap:0}
  .game-top{
    border-width:0 0 2px;
    min-height:68px;
    align-items:flex-start;
    flex-direction:column;
  }
  .hud-strip{justify-content:flex-start;width:100%}
  .hud-strip span{font-size:9px;min-height:26px}
  .hud-strip b{font-size:13px}
  .restart-button{
    position:absolute;
    top:7px;
    right:8px;
    min-height:28px;
    font-size:9px;
  }
  .canvas-wrap{
    border-width:0;
    box-shadow:none;
  }
  canvas{min-height:0}
  .controls-bar{
    border-width:2px 0 0;
    grid-template-columns:44px 44px minmax(0,1fr) 62px;
    gap:7px;
    padding:6px 8px;
    padding-bottom:max(7px,env(safe-area-inset-bottom));
  }
  .screen-panel{
    width:calc(100% - 20px);
    padding:12px;
    box-shadow:5px 5px 0 #000;
  }
  .setup-grid{grid-template-columns:1fr}
  .sticker-card{width:64px;height:64px}
  .sticker-card canvas{width:54px;height:54px}
  .control-button{width:44px;min-height:44px;font-size:8px}
  .slap-button{width:62px;min-height:62px;font-size:11px}
}
@media(max-width:920px) and (orientation:landscape){
  canvas{
    min-height:0;
  }
  .game-top{
    min-height:44px;
    flex-direction:row;
    align-items:center;
    padding:5px 7px;
  }
  .brand{
    font-size:12px;
  }
  .brand-mark{
    width:22px;
    height:22px;
    border-width:3px;
  }
  .brand-mark:after{
    inset:4px;
    border-width:2px;
  }
  .hud-strip{
    justify-content:flex-end;
    width:auto;
    gap:5px;
  }
  .hud-strip span{
    min-height:24px;
    padding:0 7px;
  }
  .hud-strip b{
    font-size:13px;
  }
  .restart-button{
    position:static;
    min-height:26px;
    padding:0 8px;
    font-size:9px;
  }
  .controls-bar{
    min-height:52px;
    grid-template-columns:42px 42px minmax(0,1fr) 60px;
    padding:5px 8px;
    padding-bottom:max(5px,env(safe-area-inset-bottom));
  }
  .slap-button{
    width:60px;
    min-height:60px;
    font-size:10px;
  }
  .control-button{
    width:42px;
    min-height:42px;
    font-size:8px;
  }
  .sticker-chip{
    width:42px;
    height:42px;
  }
  .sticker-chip canvas{
    width:36px;
    height:36px;
  }
  .screen-panel{
    width:min(540px,calc(100% - 20px));
    max-height:calc(100% - 16px);
    padding:10px;
  }
  h1{font-size:clamp(38px,9vw,70px)}
  h2{font-size:clamp(28px,7vw,52px)}
  .lede,.screen-panel p{font-size:12px}
  .setup-grid{
    grid-template-columns:1fr 1fr;
    margin:8px 0;
  }
  .sticker-picker{
    padding-bottom:8px;
  }
  .sticker-card{
    width:54px;
    height:54px;
  }
  .sticker-card canvas{
    width:46px;
    height:46px;
  }
  .button{
    min-height:36px;
    font-size:11px;
  }
}
@media(max-width:720px) and (orientation:portrait){
  .game-frame{
    visibility:hidden;
  }
  .rotate-notice{
    position:fixed;
    inset:0;
    z-index:100;
    display:grid;
    place-items:center;
    padding:18px;
    background:
      radial-gradient(circle at 30% 15%, rgba(227,6,19,.35), transparent 32%),
      linear-gradient(180deg,#111,#050505);
  }
  .rotate-notice>div{
    width:min(340px,100%);
    border:3px solid white;
    background:rgba(5,5,5,.94);
    padding:18px;
    box-shadow:7px 7px 0 #000;
  }
  .rotate-notice p{
    margin:10px 0 0;
    color:#d0d0d0;
    font-size:15px;
    line-height:1.45;
  }
}
@media(max-width:390px){
  .brand{font-size:12px}
  .controls-bar{grid-template-columns:40px 40px minmax(0,1fr) 58px}
  .control-button{width:40px;min-height:40px}
  .slap-button{width:58px;min-height:58px}
  .sticker-chip{width:44px;height:44px}
}
