/* Tracking, game, rating, extras — graffiti-first, works on default tokens too */
.demo-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 3px;
  background: var(--accent-2, #F7C43A);
  color: #1A120C;
  margin-inline-start: 6px;
  vertical-align: middle;
}
.order-bar {
  position: absolute;
  left: 10px; right: 10px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  z-index: 18;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 8px 0 rgba(0,0,0,.35);
  cursor: pointer;
  text-align: start;
}
.order-bar.is-on { display: flex; }
.order-bar b { font-family: var(--display, inherit); font-weight: 400; font-size: 14px; }
.order-bar span { display: block; font-size: 11px; color: var(--muted); }
.order-bar .ring-mini { width: 28px; height: 28px; flex: 0 0 28px; }

.table-chip {
  display: none;
  margin: 0 0 10px;
  padding: 8px 12px;
  background: var(--accent);
  color: #1A120C;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 3px 3px 0 #1A120C;
}
.table-chip.is-on { display: block; }

.build-extras {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0 0 8px;
}
.build-extras button {
  padding: 6px 12px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
  background: rgba(0,0,0,.35);
  color: var(--text);
}
html[data-theme="graffiti"] .build-extras button { font-family: var(--display); font-weight: 400; }

/* screens share .screen */
.track-wrap, .rate-wrap, .game-wrap { padding-bottom: 16px; }
.track-code {
  text-align: center;
  margin: 6px 0 16px;
}
.track-code em {
  font-style: normal;
  font-family: var(--display, inherit);
  font-size: 28px;
  letter-spacing: .08em;
  background: #F6EFE4;
  color: #1A120C;
  border: 2px solid #1A120C;
  box-shadow: 3px 3px 0 var(--accent);
  padding: 4px 14px 2px;
  display: inline-block;
  transform: rotate(-1.5deg);
}
.ring-box { display: grid; place-items: center; margin: 8px auto 18px; position: relative; width: 168px; height: 168px; }
.ring-box svg { width: 168px; height: 168px; transform: rotate(-90deg); }
.ring-box .ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-box .ring-label b { font-size: 28px; font-family: var(--display, inherit); font-weight: 400; line-height: 1; }
.ring-box .ring-label span { font-size: 11px; color: var(--muted); margin-top: 4px; }

.timeline { display: flex; flex-direction: column; gap: 0; margin: 0 8px 16px; }
.tl-step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); background: var(--elev); flex: 0 0 16px; margin-top: 4px; }
.tl-step.is-done .tl-dot, .tl-step.is-on .tl-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-step.is-on .tl-dot { animation: pulse 1.2s ease infinite; }
.tl-line { width: 2px; flex: 1; min-height: 22px; background: var(--line); }
.tl-step:last-child .tl-line { display: none; }
.tl-step.is-done .tl-line { background: var(--accent); }
.tl-body { padding-bottom: 16px; }
.tl-body b { display: block; font-size: 15px; }
.tl-body span { color: var(--muted); font-size: 12px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }

.track-actions { display: flex; flex-direction: column; gap: 8px; }
.track-actions .cta, .rate-wrap .cta, .game-wrap .cta { justify-content: center; }
.ghost {
  width: 100%;
  min-height: 44px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  font-weight: 800;
  color: var(--muted);
  background: transparent;
}
html[data-theme="graffiti"] .ghost { border-color: rgba(255,138,20,.35); color: var(--accent-2); }

/* rating */
.star-row { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; }
.star-row label { font-weight: 800; }
.stars { display: flex; gap: 4px; direction: ltr; }
.stars button { font-size: 26px; line-height: 1; color: #5a4a3a; }
.stars button.is-on { color: var(--accent-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.tags button {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--elev);
  font-weight: 700;
  font-size: 12px;
}
.tags button.is-on { background: var(--accent); color: #1A120C; border-color: #1A120C; }
.rate-wrap textarea {
  width: 100%;
  min-height: 80px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: rgba(0,0,0,.25);
  color: var(--text);
  padding: 10px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
}
.coupon {
  margin: 16px auto;
  text-align: center;
  background: #F6EFE4;
  color: #1A120C;
  border: 2px dashed #1A120C;
  padding: 14px;
  border-radius: 8px;
  transform: rotate(-1deg);
}
.coupon b { display: block; font-size: 26px; letter-spacing: .12em; font-family: var(--en, inherit); }

/* loyalty */
.loyalty { margin: 14px 0; padding: 12px; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; }
.loyalty h3 { margin: 0 0 8px; font-size: 15px; font-family: var(--display, inherit); font-weight: 400; }
.stamps { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.stamp {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px dashed var(--line);
  display: grid; place-items: center;
  font-size: 14px;
  opacity: .4;
}
.stamp.is-on { opacity: 1; background: var(--accent); border-style: solid; border-color: #1A120C; color: #1A120C; }

/* game */
.game-lobby { display: flex; flex-direction: column; gap: 10px; }
.ident { text-align: center; margin: 4px 0 10px; }
.ident .av { font-size: 36px; }
.ident b { display: block; font-size: 20px; font-family: var(--display, inherit); font-weight: 400; }
.room-row { display: flex; gap: 8px; }
.room-row input {
  flex: 1;
  min-height: 48px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: rgba(0,0,0,.3);
  color: var(--text);
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.game-status { text-align: center; color: var(--muted); font-size: 13px; min-height: 20px; }
.dom-arena { min-height: 160px; overflow-x: auto; padding: 16px 8px; display: flex; align-items: center; justify-content: center; }
.dom-line { display: flex; align-items: center; gap: 2px; }
.dtile {
  width: 28px; height: 56px;
  background: linear-gradient(#fff8e8, #f0e2c8);
  border: 2px solid #1A120C;
  border-radius: 5px;
  display: flex; flex-direction: column;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35);
  flex: 0 0 auto;
  position: relative;
}
.dtile.hz { width: 56px; height: 28px; flex-direction: row; }
.dtile .half { flex: 1; display: grid; place-items: center; font-size: 11px; color: #1A120C; font-weight: 800; line-height: 1; }
.dtile .bar { height: 2px; background: #1A120C; }
.dtile.hz .bar { width: 2px; height: auto; }
.dtile.back { background: repeating-linear-gradient(45deg, #5c2010, #5c2010 4px, #7a2e14 4px, #7a2e14 8px); }
.dtile.back .half, .dtile.back .bar { visibility: hidden; }
.dtile.legal { outline: 2px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 2px 2px 0 #1A120C; cursor: pointer; }
.dtile.picked { transform: translateY(-6px); outline: 2px solid var(--pink, #FF2D55); }
.dom-hand { display: flex; gap: 6px; overflow-x: auto; padding: 8px 4px 12px; justify-content: center; flex-wrap: wrap; }
.dom-hand .dtile { width: 36px; height: 72px; }
.dom-hand .dtile .half { font-size: 14px; }
.opp-row, .me-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.opp-row .av, .me-row .av { font-size: 22px; }
.side-picks { display: flex; gap: 8px; justify-content: center; margin: 6px 0; }
.side-picks button { padding: 8px 16px; border-radius: 8px; background: var(--accent); color: #1A120C; font-weight: 800; }
.game-over-card { text-align: center; padding: 16px; background: var(--card); border-radius: 12px; border: 2px solid var(--accent); margin: 10px 0; }

#shareCard { position: fixed; left: -9999px; top: 0; }

/* Wallet preview modal (demo only — not a signed pass) */
.wallet-sheet { position: absolute; inset: 0; background: rgba(0,0,0,.62); z-index: 32; display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(16px + var(--safe-b)); }
.wallet-sheet[hidden] { display: none !important; }
.wallet-card-wrap { width: 100%; max-width: 400px; animation: sheetUp .32s cubic-bezier(.22,.8,.24,1); }
.wallet-card-wrap h3 { text-align: center; margin: 0 0 8px; font-size: 15px; }
.pass {
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
}
.pass.apple { background: linear-gradient(180deg, #2a2118, #14110e 40%, #0e0c0a); color: #f6efe4; }
.pass.google { background: #fff; color: #1a120c; border: 1px solid #e6e0d6; }
.pass-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.pass-top img { width: 44px; height: 44px; object-fit: contain; background: #fff; border-radius: 8px; }
.pass-top .name { font-weight: 800; font-size: 15px; line-height: 1.2; }
.pass-top .sub { font-size: 11px; opacity: .7; }
.pass.apple .strip { height: 8px; background: linear-gradient(90deg, #ff8a14, #ff2d55 50%, #3ddb5d); }
.pass.google .strip { height: 6px; background: #f79622; }
.pass-body { padding: 12px 16px 16px; }
.pass-meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 10px; }
.pass-meta b { display: block; font-size: 16px; }
.pass .stamps { margin: 8px 0 12px; }
.pass.google .stamp { border-color: #d9d0c4; }
.pass.google .stamp.is-on { background: #f79622; color: #1a120c; border-color: #1a120c; }
.pass-qr { display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 10px; margin: 0 auto; width: 148px; }
.pass-qr canvas { width: 128px; height: 128px; display: block; }
.pass-foot { text-align: center; font-size: 10px; margin-top: 8px; opacity: .7; }
.wallet-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.wallet-btns button {
  min-height: 48px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-apple { background: #111; color: #fff; border: 1px solid #333; }
.btn-google { background: #fff; color: #1a120c; border: 2px solid #1a120c; }
.owner-link { font-size: 11px; color: var(--muted); text-align: center; margin: 10px 0 0; }
.owner-link a { color: var(--accent); }

button.tile-btn {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}
.tabbar .tab { flex: 1; min-width: 0; }
#openGameFromMenu { margin-top: 4px; }
.pass .stamps { grid-template-columns: repeat(8, 1fr); }
.order-bar b, .order-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* Four tabs + hide the slim order bar on full screens that already show status */
.tabbar { grid-template-columns: repeat(4, 1fr); }
.tabbar .tab { font-size: 10px; overflow: hidden; }
body:has(#screen-track.is-active) #orderBar,
body:has(#screen-game.is-active) #orderBar,
body:has(#screen-rate.is-active) #orderBar { display: none !important; }
.track-wrap, .rate-wrap, .game-wrap { padding-bottom: 24px; }
.coupon b { font-family: ui-monospace, "Cascadia Mono", "Courier New", monospace; letter-spacing: .08em; }
