/* public/games/splash/splash.css
   Version: v2.2
   Last edited: 2026-04-05 17:04 */

:root{
  --ink:#e2e8f0;
  --mut:#94a3b8;
  --accent:#38bdf8;

  --bg:#d9dbe1;
  --panel:rgba(2,6,23,.52);
  --panel-soft:rgba(15,23,42,.38);
  --line:rgba(148,163,184,.14);

  --safe-top:env(safe-area-inset-top,0px);
  --safe-right:env(safe-area-inset-right,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-left:env(safe-area-inset-left,0px);

  --topbar-h:58px;
  --dock-h:72px;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0);}
html,body{margin:0;height:100%;overflow:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%;}
body{background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;}
button,input,select,textarea{font:inherit;}
*:not(input):not(textarea):not(select){user-select:none;-webkit-user-select:none;}
input,textarea,select{user-select:auto;-webkit-user-select:text;}

/* top */
.topbar{
  position:fixed;top:0;left:0;right:0;z-index:1000;
  height:calc(var(--topbar-h) + var(--safe-top));
  padding:calc(8px + var(--safe-top)) calc(10px + var(--safe-right)) 8px calc(10px + var(--safe-left));
  display:flex;align-items:flex-end;justify-content:center;
  background:rgba(255,255,255,.74);
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
  border-bottom:1px solid rgba(148,163,184,.10);
}
.topbar h1{
  margin:0;font-size:19px;line-height:1;font-weight:800;letter-spacing:-.03em;color:#020617;
}
.top-save-btn{
  position:absolute;right:calc(10px + var(--safe-right));bottom:8px;
  min-height:36px;padding:0 12px;border-radius:18px;
  border:1px solid rgba(56,189,248,.30);
  background:rgba(30,64,175,.92);color:#fff;font-size:14px;
  box-shadow:0 4px 14px rgba(2,6,23,.16);
}

/* stage */
.stage-wrap{
  position:absolute;top:calc(var(--topbar-h) + var(--safe-top));left:0;right:0;
  bottom:calc(var(--dock-h) + var(--safe-bottom));
  padding:6px 8px 2px;
}
.stage-card{height:100%;display:flex;flex-direction:column;}
.stage-toolbar{display:flex;justify-content:center;gap:6px;margin-bottom:4px;}
.stage-pill{
  min-height:30px;padding:0 10px;border-radius:14px;
  border:1px solid rgba(148,163,184,.10);
  background:rgba(255,255,255,.68);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  color:#0f172a;font-size:12px;
}
.stage-shell{flex:1 1 auto;min-height:0;display:flex;align-items:flex-start;justify-content:center;overflow:hidden;}
.splash-stage{
  position:relative;
  width:min(100%, calc(100vh - var(--topbar-h) - var(--safe-top) - var(--dock-h) - var(--safe-bottom) - 16px));
  aspect-ratio:1 / 1;border-radius:24px;overflow:hidden;
  background:linear-gradient(135deg,#0f172a,#1f2937);
  box-shadow:0 10px 30px rgba(2,6,23,.14);
}
.stage-safe-zone{
  position:absolute;inset:6%;border:2px dashed rgba(255,255,255,.16);border-radius:16px;pointer-events:none;z-index:5;
}
.stage-text{
  position:absolute;left:7%;top:12%;width:86%;z-index:3;text-align:center;
  transform-origin:50% 0%;pointer-events:auto;touch-action:none;
}
.stage-text .line{margin:0 0 .05em 0;line-height:1.06;word-break:break-word;}
.stage-text .line-1{
  font-size:74px;font-weight:800;
  background:linear-gradient(90deg,#5b8cff,#a855f7);-webkit-background-clip:text;background-clip:text;color:transparent;
}
.stage-text .line-2{
  font-size:34px;font-weight:600;
  background:linear-gradient(90deg,#ffffff,#b7c5e8);-webkit-background-clip:text;background-clip:text;color:transparent;
}
.stage-text .line-3{
  font-size:20px;font-weight:400;
  background:linear-gradient(90deg,#cfd8ea,#9aa8c2);-webkit-background-clip:text;background-clip:text;color:transparent;
}
.stage-image{
  position:absolute;left:50%;top:28%;width:35%;max-width:none;
  transform:translate(-50%,-50%);display:none;z-index:2;
  touch-action:none;-webkit-user-drag:none;user-select:none;
}
.stage-hint{margin:3px 4px 0;text-align:center;color:#64748b;font-size:11px;line-height:1.2;}

/* dock */
.dock{
  position:fixed;left:0;right:0;bottom:0;z-index:1100;
  display:flex;gap:6px;
  padding:5px calc(8px + var(--safe-right)) calc(5px + var(--safe-bottom)) calc(8px + var(--safe-left));
  background:linear-gradient(180deg, rgba(2,6,23,.10) 0%, rgba(2,6,23,.88) 38%, rgba(2,6,23,.96) 100%);
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
  border-top-left-radius:22px;border-top-right-radius:22px;
}
.dock-btn{
  flex:1 1 0;min-width:0;min-height:56px;border-radius:18px;
  border:1px solid rgba(148,163,184,.12);
  background:rgba(15,23,42,.42);color:var(--ink);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:4px 2px;
}
.dock-btn span{font-size:17px;line-height:1;}
.dock-btn em{font-style:normal;font-size:10.5px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

/* backdrop */
.backdrop{
  position:fixed;inset:0;background:rgba(2,6,23,.12);
  -webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);
  opacity:0;pointer-events:none;transition:opacity .18s ease;z-index:1150;
}
.backdrop.show,.backdrop[aria-hidden="false"]{opacity:1;pointer-events:auto;}

/* sheets */
.sheet{
  position:fixed;left:0;right:0;bottom:var(--safe-bottom);z-index:1200;
  background:rgba(2,6,23,.52);
  -webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);
  border-top-left-radius:22px;border-top-right-radius:22px;
  border:1px solid rgba(148,163,184,.10);
  box-shadow:0 -8px 28px rgba(2,6,23,.22);
  transform:translateY(105%);transition:transform .22s ease-out;overflow:hidden;
}
.sheet.open{transform:translateY(0);}
.sheet-small{max-height:36vh;}
.sheet-medium{max-height:56vh;}

.sheet-handle{
  width:50px;height:5px;margin:8px auto 0;border-radius:9999px;background:rgba(148,163,184,.22);
}
.sheet-head{
  display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px 4px;
}
.sheet-head h3{margin:0;font-size:13px;font-weight:800;}
.sheet-body{
  padding:6px 10px 12px;overflow:auto;-webkit-overflow-scrolling:touch;
}
.sheet-small .sheet-body{max-height:calc(36vh - 44px);}
.sheet-medium .sheet-body{max-height:calc(56vh - 76px);}

.sheet .row{display:flex;gap:6px;margin:6px 0;flex-wrap:wrap;}

/* tabs */
.sheet-tabs{
  display:flex;
  gap:6px;
  padding:0 10px 4px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.sheet-tab{
  flex:0 0 auto;
  min-height:30px;
  padding:0 10px;
  border-radius:9999px;
  border:1px solid var(--line);
  background:rgba(15,23,42,.36);
  color:var(--mut);
  font-size:11px;
}
.sheet-tab.active{
  background:rgba(56,189,248,.14);
  border-color:rgba(56,189,248,.32);
  color:var(--ink);
}
.tab-panel{display:none;}
.tab-panel.active{display:block;}

/* controls */
.label{display:block;margin:6px 0 4px;font-size:11px;color:var(--mut);}
.input,.select{
  width:100%;min-height:40px;padding:8px 10px;border-radius:12px;
  border:1px solid var(--line);background:rgba(15,23,42,.42);
  color:var(--ink);font-size:12px;outline:none;
}
.input::placeholder{color:#94a3b8;}

.pill,.chip{
  min-height:38px;border-radius:14px;border:1px solid var(--line);
  background:rgba(15,23,42,.40);color:var(--ink);font-size:12px;
}
.pill{padding:0 10px;}
.chip{
  display:flex;align-items:center;gap:7px;padding:7px 9px;
}
.chip.grow{flex:1 1 0;}
.chip input[type="color"]{
  width:24px;height:24px;padding:0;border:0;border-radius:6px;overflow:hidden;
}
.chip input[type="checkbox"]{width:18px;height:18px;}
.chip input[type="range"],.chip select{flex:1 1 auto;}

.x-btn{
  width:34px;height:34px;border-radius:12px;border:1px solid var(--line);
  background:rgba(30,41,59,.72);color:#fff;font-size:17px;
}

.muted{color:var(--mut);font-size:11px;line-height:1.25;}

body.sheet-open .dock{opacity:.96;}
body.hide-safe-zone .stage-safe-zone{display:none;}

@media (min-width:760px){
  .dock{left:12px;right:12px;max-width:860px;margin:0 auto;}
  .sheet{
    left:50%;
    right:auto;
    width:min(720px, calc(100vw - 20px));
    transform:translate(-50%,105%);
  }
  .sheet.open{transform:translate(-50%,0);}
}

@media (max-width:430px){
  :root{--topbar-h:56px;--dock-h:68px;}
  .topbar h1{font-size:18px;}
  .top-save-btn{min-height:34px;padding:0 10px;font-size:13px;}
  .stage-pill{min-height:28px;padding:0 9px;font-size:11px;}
  .dock-btn{min-height:54px;}
  .dock-btn span{font-size:16px;}
  .dock-btn em{font-size:10px;}
  .sheet-small{max-height:34vh;}
  .sheet-medium{max-height:54vh;}
  .sheet-small .sheet-body{max-height:calc(34vh - 44px);}
  .sheet-medium .sheet-body{max-height:calc(54vh - 76px);}
}