:root {
  --bg: #12151a;
  --panel: #1c2128;
  --text: #eef2f6;
  --muted: #8b969f;
  --line: rgba(255,255,255,.1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.score {
  position: fixed; top: calc(10px + var(--safe-top)); left: 0; right: 0;
  text-align: center; z-index: 5; pointer-events: none;
  font-weight: 800; font-size: 22px;
}
.score small {
  display: block; font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}
.end {
  position: fixed; inset: 0; z-index: 8;
  display: grid; place-items: center;
  background: rgba(8,10,14,.5);
  text-align: center;
}
.end[hidden] { display: none; }
.end > div {
  width: min(100%, 24rem);
  padding: 0 24px;
  text-align: center;
}
.end b {
  display: block;
  text-align: center;
  font-size: clamp(40px, 14vw, 72px);
  line-height: 1.05;
}
.end span {
  display: block;
  text-align: center;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}
.hub {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 10px;
  padding: calc(16px + var(--safe-top)) 12px calc(16px + var(--safe-bottom));
  overflow: auto;
}
.hub h1 {
  grid-column: 1 / -1;
  margin: 4px 4px 8px;
  font-size: 15px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.hub a {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 4px;
  min-height: 110px;
  aspect-ratio: 1.05 / 1;
  padding: 14px;
  border-radius: 18px;
  border: 0;
  font-weight: 800;
  letter-spacing: .1em;
  font-size: 18px;
  color: #142018;
}
.hub a small {
  font-size: 11px;
  letter-spacing: .04em;
  font-weight: 700;
  opacity: .7;
}
.hub a:active { transform: scale(.98); }
.hub a.tile-line { background: #6fbf63; color: #142018; }
.hub a.tile-park { background: #4d8dff; color: #fff; }
.hub a.tile-park small { color: #eef6ff; }
.hub a.tile-sort { background: #3ee0d4; color: #142018; }
.hub a.tile-pipes { background: linear-gradient(145deg,#ff3158 0 32%,#39f875 33% 65%,#3288ff 66%); color:#fff; text-shadow:0 1px 6px #07111f; }
.hub a.tile-bolts { background: #f0a23a; color: #142018; }
.dock {
  position: fixed; left: 8px; right: 8px;
  bottom: calc(8px + var(--safe-bottom));
  display: grid; gap: 8px; z-index: 4;
}
.dock.cols-3 { grid-template-columns: repeat(3, 1fr); }
.dock.cols-4 { grid-template-columns: repeat(4, 1fr); }
.dock.cols-5 { grid-template-columns: repeat(5, 1fr); }
.pad {
  min-height: 64px; border: 0; border-radius: 14px; font-weight: 800;
}
.queue {
  position: fixed; left: 8px; right: 8px;
  top: calc(52px + var(--safe-top));
  display: flex; gap: 8px; z-index: 3;
  pointer-events: none;
}
.customer {
  flex: 1; min-height: 88px; border-radius: 14px;
  background: var(--panel); border: 2px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  pointer-events: auto;
}
.customer.hot { border-color: #fff; }
.dots { display: flex; gap: 4px; }
.dot { width: 16px; height: 16px; border-radius: 5px; }
.plate {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(88px + var(--safe-bottom));
  display: flex; gap: 6px; z-index: 3;
  min-height: 36px;
}
.patience { height: 4px; width: 80%; background: #333; border-radius: 4px; overflow: hidden; }
.patience i { display: block; height: 100%; width: 100%; background: #3dff7a; }
.game-menu-button { position:fixed; z-index:40; right:12px; top:calc(10px + var(--safe-top)); width:46px; height:46px; border:1px solid rgba(255,255,255,.14); border-radius:15px; background:linear-gradient(145deg,#29435f,#16283e); color:#eef6ff; font-size:24px; font-weight:900; line-height:1; box-shadow:0 7px 20px #06111f66; }
.game-menu { position:fixed; inset:0; z-index:40; display:grid; place-items:center; padding:18px; background:rgba(5,9,16,.68); backdrop-filter:blur(6px); }
.game-menu[hidden], .game-confirm[hidden] { display:none; }
.game-menu-panel { position:relative; width:min(344px,100%); border:1px solid rgba(148,180,218,.28); border-radius:26px; background:linear-gradient(155deg,#1d2c41,#111b2a); color:#edf5ff; padding:20px; box-shadow:0 24px 70px #000b,inset 0 1px rgba(255,255,255,.06); }
.game-menu-panel h2 { margin:1px 48px 17px 2px; font-size:24px; }
.game-menu-action { display:grid; grid-template-columns:50px 1fr; align-items:center; width:100%; border:1px solid rgba(154,184,220,.2); border-radius:17px; background:linear-gradient(145deg,rgba(54,76,105,.78),rgba(38,55,78,.78)); color:#eef5ff; padding:10px 12px; margin:0 0 9px; text-align:left; }
.game-menu-action:active { transform:scale(.985); }
.game-menu-icon { display:grid; place-items:center; width:40px; height:40px; border:1px solid rgba(163,195,235,.16); border-radius:13px; background:#142135; color:#dceaff; font-size:17px; font-style:normal; font-weight:900; }
.game-menu-copy b,.game-menu-copy span { display:block; }.game-menu-copy b{font-size:15px}.game-menu-copy span{color:#aebfd3;font-size:11px;line-height:1.35;margin-top:3px}
.game-menu-close { position:absolute; right:15px; top:15px; width:36px; height:36px; border:1px solid rgba(255,255,255,.1); border-radius:12px; background:#111d2d; color:#bfcde0; font-size:22px; line-height:1; }
.game-confirm { position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:18px; background:rgba(5,8,13,.74); backdrop-filter:blur(7px); }
.game-confirm-box { width:min(330px,100%); border:1px solid rgba(154,184,220,.25); border-radius:24px; padding:22px; background:linear-gradient(155deg,#202e42,#121c2b); color:#eef2f6; text-align:left; box-shadow:0 24px 70px #000b; }
.game-confirm-box b { display:block; margin-bottom:8px; font-size:21px; }.game-confirm-box p{margin:0 0 20px;color:#aebed0;font-size:13px;line-height:1.45}.game-confirm-row{display:flex;justify-content:flex-end;gap:9px}.game-confirm-row button{border:0;border-radius:13px;min-width:96px;min-height:44px;padding:0 16px;font-weight:850}.game-confirm-cancel{background:#29384c;color:#dce7f5}.game-confirm-yes{background:linear-gradient(145deg,#50dc7d,#32bb62);color:#0d2616}

