@font-face {
  font-family: 'Bricolage';
  src: url('../shared/fonts/bricolagegrotesque.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --maroon: #8a1c2b;
  --maroon-deep: #5e0f1b;
  --cream: #fdf8ee;
  --ink: #f6f1e4;
  --muted: #b9c9bd;
  --gold: #f2b73a;
  --felt: #0f5a3e;
  --felt-deep: #083522;
  --panel: rgba(4, 22, 14, 0.55);
  --cw: 64px;
  --ch: 92px;
}

body[data-theme='indigo'] { --felt: #23307a; --felt-deep: #10173f; }
body[data-theme='wine'] { --felt: #6d1d38; --felt-deep: #33091a; }
body[data-theme='wood'] { --felt: #7a4b26; --felt-deep: #3a200d; }
body[data-theme='night'] { --felt: #263238; --felt-deep: #0e1417; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: 'Bricolage', system-ui, sans-serif;
  color: var(--ink);
  background: var(--felt-deep);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background:
    radial-gradient(130% 80% at 50% 40%, var(--felt), var(--felt-deep) 78%);
}

/* subtle felt grain */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.screen[hidden] { display: none !important; }

/* ---------- home ---------- */
.home-inner {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.logo { text-align: center; }
.logo h1 {
  margin: 14px 0 0;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
.logo h1 span { color: var(--gold); }

.logo-cards { position: relative; height: 110px; }
.mini {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 66px;
  height: 96px;
  margin-left: -33px;
  border-radius: 9px;
  background: var(--cream);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}
.mini.c1 { transform: rotate(-16deg) translateX(-34px); background: var(--maroon); border: 3px solid var(--cream); }
.mini.c2 { transform: rotate(0deg) translateY(-6px); }
.mini.c3 { transform: rotate(16deg) translateX(34px); }
.mini.c2::after, .mini.c3::after {
  content: '';
  position: absolute;
  inset: 26px 15px;
  background: var(--maroon);
}
.mini.c2::after { border-radius: 50%; inset: 30px 15px; }
.mini.c3::after { clip-path: polygon(50% 0, 100% 100%, 0 100%); }

.home-actions { display: flex; flex-direction: column; gap: 10px; }
.home-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.record { text-align: center; color: var(--muted); margin: 0; font-size: 15px; min-height: 1.2em; }

/* ---------- buttons, panels ---------- */
.btn {
  font: inherit;
  font-weight: 650;
  font-size: 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn.big { font-size: 19px; padding: 17px; }
.btn.primary { background: var(--gold); color: #3b2500; border-color: transparent; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.btn.danger { color: #ffb4a8; }
.btn.share { background: #1fa855; border-color: transparent; color: #fff; }
.btn.share svg { width: 20px; height: 20px; fill: #fff; }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.panel {
  position: relative;
  width: min(400px, 100%);
  max-height: 100%;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(6px);
}
.panel.scroll, .sheet-card.scroll { overflow-y: auto; }
.panel h2 { margin: 0 0 4px 44px; font-size: 24px; line-height: 40px; font-weight: 750; }
.panel p { margin: 0; line-height: 1.5; color: #dfe8e1; }

.back-btn {
  position: absolute;
  left: 14px;
  top: 20px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.back-btn svg, .table-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.field-label { font-size: 14px; color: var(--muted); margin-top: 4px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(0, 0, 0, 0.25); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button {
  font: inherit;
  font-weight: 650;
  font-size: 16px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 11px 6px;
  cursor: pointer;
}
.seg button.on { background: var(--cream); color: var(--maroon); }

.input {
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
  width: 100%;
  user-select: text;
  -webkit-user-select: text;
}
.input:focus { border-color: var(--gold); }
.input.code { text-transform: uppercase; letter-spacing: 6px; font-weight: 750; text-align: center; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.14); }
.note { margin: -4px 0 0 !important; font-size: 14px; color: var(--muted) !important; text-align: center; }
.btn[hidden] { display: none; }
.hint { min-height: 1.3em; font-size: 15px; color: #ffd38a !important; text-align: center; }

.room-code {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 10px;
  text-align: center;
  color: var(--gold);
  padding: 4px 0;
}

.seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.seats li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 600;
}
.seats li.empty { color: var(--muted); font-weight: 500; border: 1px dashed rgba(255, 255, 255, 0.16); background: transparent; }
.seats .tag { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; }

.check { display: flex; align-items: center; gap: 10px; font-size: 16px; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.check[hidden] { display: none; }

.rule-list { display: grid; grid-template-columns: 44px 1fr; gap: 10px 10px; margin: 6px 0; align-items: start; }
.rule-list dt {
  background: var(--cream);
  color: var(--maroon);
  font-weight: 800;
  border-radius: 8px;
  text-align: center;
  padding: 6px 0;
}
.rule-list dd { margin: 0; line-height: 1.45; padding-top: 4px; color: #e3ebe5; }

.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.theme {
  font: inherit;
  border: 2px solid transparent;
  border-radius: 14px;
  height: 78px;
  color: #fff;
  font-weight: 650;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 8px;
  gap: 2px;
}
.theme.on { border-color: var(--gold); }
.theme small { font-weight: 500; font-size: 11px; opacity: 0.85; }
.small-link { color: var(--muted); font-size: 14px; text-align: center; margin-top: 8px; }

/* ---------- table ---------- */
.screen.table { padding: 0; display: block; }
.felt { position: absolute; inset: 0; overflow: hidden; }

.table-btn {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  display: grid;
  place-items: center;
  z-index: 300;
  cursor: pointer;
}

.card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cw);
  height: var(--ch);
  transition: transform 0.34s cubic-bezier(0.25, 0.8, 0.3, 1), opacity 0.2s;
  will-change: transform;
  perspective: 600px;
  cursor: default;
}
.card .inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.34s ease;
}
.card.down .inner { transform: rotateY(180deg); }
.card .face, .card .back {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cw) * 0.12);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}
.card .back { transform: rotateY(180deg); }
.card.mine { cursor: pointer; }

.face {
  background: var(--cream);
  color: var(--maroon);
  overflow: hidden;
}
.face svg { fill: var(--maroon); display: block; }
.corner {
  position: absolute;
  left: 6%;
  top: 4%;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.corner b { font-weight: 800; font-size: calc(var(--cw) * 0.24); letter-spacing: -0.5px; }
.corner .pip { width: calc(var(--cw) * 0.15); height: calc(var(--cw) * 0.15); margin-top: 2px; }
.corner .w-mark { font-weight: 800; font-size: calc(var(--cw) * 0.13); margin-top: 2px; }
.corner.flip { left: auto; top: auto; right: 6%; bottom: 4%; transform: rotate(180deg); }
.centre {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54%;
  height: 54%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
}
.centre svg { width: 100%; height: 100%; }
.centre.star span {
  position: absolute;
  color: var(--cream);
  font-weight: 800;
  font-size: calc(var(--cw) * 0.17);
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.whot-word {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: calc(var(--cw) * 0.22);
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: -2px;
}

.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 9px),
    var(--maroon);
  border: calc(var(--cw) * 0.05) solid var(--cream);
  display: grid;
  place-items: center;
}
.back span {
  color: var(--cream);
  font-weight: 800;
  font-size: calc(var(--cw) * 0.19);
  letter-spacing: 1px;
  transform: rotate(-30deg);
}

.seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 200;
  pointer-events: none;
  transition: opacity 0.2s;
}
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 19px;
  background: var(--cream);
  color: var(--maroon);
  border: 3px solid rgba(0, 0, 0, 0.25);
  position: relative;
}
.seat.turn .avatar { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(242, 183, 58, 0.35); }
.seat .name {
  font-weight: 700;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 9px;
  border-radius: 99px;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seat .count {
  position: absolute;
  right: -8px;
  bottom: -4px;
  min-width: 22px;
  height: 22px;
  border-radius: 99px;
  background: var(--maroon);
  color: var(--cream);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--cream);
}
.seat .flag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #3b2500;
  background: var(--gold);
  padding: 2px 7px;
  border-radius: 99px;
}
.seat .flag.away { background: #c9d2cc; }
.seat .timer {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) var(--p, 0%), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 27px, #000 28px);
  mask: radial-gradient(circle, transparent 27px, #000 28px);
}

.market-label, .pile-label {
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  pointer-events: none;
}
.market-hit {
  position: absolute;
  z-index: 150;
  border-radius: 12px;
  cursor: pointer;
}
.market-label.warn { color: var(--gold); }

.status {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 210;
  pointer-events: none;
}
.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  color: var(--maroon);
  font-weight: 800;
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 99px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}
.chip svg { width: 16px; height: 16px; fill: var(--maroon); }
.chip.warn { background: var(--gold); color: #3b2500; }

.banner {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  z-index: 400;
  pointer-events: none;
  font-weight: 800;
  font-size: 34px;
  color: var(--cream);
  text-shadow: 0 3px 0 var(--maroon-deep), 0 8px 24px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  transition: transform 0.25s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.2s;
}
.banner.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }

.your-turn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 750;
  font-size: 14px;
  color: #3b2500;
  background: var(--gold);
  padding: 4px 12px;
  border-radius: 99px;
  z-index: 210;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.your-turn.show { opacity: 1; }

/* ---------- sheets ---------- */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 14, 9, 0.6);
  backdrop-filter: blur(3px);
  animation: fade 0.18s ease;
}
.sheet[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.sheet-card {
  width: min(360px, 100%);
  max-height: 100%;
  background: linear-gradient(180deg, #17402f, #0f2f22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: rise 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes rise { from { transform: translateY(16px) scale(0.97); opacity: 0; } }
.sheet-card h3 { margin: 0 0 6px; font-size: 24px; font-weight: 750; text-align: center; }
.sheet-card p { margin: 0; line-height: 1.5; color: #dfe8e1; }

.shape-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shape-btn {
  font: inherit;
  background: var(--cream);
  color: var(--maroon);
  border: 0;
  border-radius: 14px;
  padding: 12px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: 750;
  font-size: 13px;
  cursor: pointer;
}
.shape-btn svg { width: 40px; height: 40px; fill: var(--maroon); }

.end-kicker { text-align: center; color: var(--muted) !important; font-weight: 600; }
.end-title { font-size: 30px !important; }
.tally { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tally li { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.06); font-weight: 600; }
.tally li.win { background: var(--gold); color: #3b2500; }

.toast {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: 57%;
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--maroon);
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 12px;
  z-index: 2000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast[hidden] { display: none; }

.tally li.out { background: rgba(138, 28, 43, 0.55); }
.tally li em { font-style: normal; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: #ffb4a8; margin-left: 6px; }
.btn[hidden] { display: none; }

/* ---------- the table: a cloth on a wooden table, lit from above ---------- */
:root { --cloth-pattern: none; }
body[data-theme='ankara'] { --felt: #1d4e8f; --felt-deep: #0d2852; --cloth-pattern: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%27130%27%20height%3D%27130%27%20viewBox%3D%270%200%2084%2084%27%3E%20%3Ccircle%20cx%3D%2721%27%20cy%3D%2721%27%20r%3D%2715%27%20fill%3D%27%23f2b73a%27%20opacity%3D%27.22%27/%3E%3Ccircle%20cx%3D%2721%27%20cy%3D%2721%27%20r%3D%278%27%20fill%3D%27%231b4fa8%27%20opacity%3D%27.3%27/%3E%3Ccircle%20cx%3D%2721%27%20cy%3D%2721%27%20r%3D%273%27%20fill%3D%27%23fdf8ee%27%20opacity%3D%27.32%27/%3E%20%3Ccircle%20cx%3D%2763%27%20cy%3D%2763%27%20r%3D%2715%27%20fill%3D%27%23e8702a%27%20opacity%3D%27.22%27/%3E%3Ccircle%20cx%3D%2763%27%20cy%3D%2763%27%20r%3D%278%27%20fill%3D%27%231b4fa8%27%20opacity%3D%27.3%27/%3E%3Ccircle%20cx%3D%2763%27%20cy%3D%2763%27%20r%3D%273%27%20fill%3D%27%23fdf8ee%27%20opacity%3D%27.32%27/%3E%20%3Cpath%20d%3D%27M63%208%20L75%2021%20L63%2034%20L51%2021%20Z%27%20fill%3D%27%23e8702a%27%20opacity%3D%27.18%27/%3E%3Cpath%20d%3D%27M21%2050%20L33%2063%20L21%2076%20L9%2063%20Z%27%20fill%3D%27%23f2b73a%27%20opacity%3D%27.18%27/%3E%20%3Ccircle%20cx%3D%2742%27%20cy%3D%2742%27%20r%3D%273%27%20fill%3D%27%23fdf8ee%27%20opacity%3D%27.2%27/%3E%3Ccircle%20cx%3D%270%27%20cy%3D%2742%27%20r%3D%273%27%20fill%3D%27%23fdf8ee%27%20opacity%3D%27.2%27/%3E%3Ccircle%20cx%3D%2784%27%20cy%3D%2742%27%20r%3D%273%27%20fill%3D%27%23fdf8ee%27%20opacity%3D%27.2%27/%3E%20%3C/svg%3E"); }
body[data-theme='lagos'] { --felt: #17264d; --felt-deep: #080f24; --cloth-pattern: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2760%27%20height%3D%2760%27%20viewBox%3D%270%200%2060%2060%27%3E%20%3Cpath%20d%3D%27M30%206%20L36%2030%20L30%2054%20L24%2030%20Z%27%20fill%3D%27%23f2b73a%27%20opacity%3D%27.16%27/%3E%3Cpath%20d%3D%27M6%2030%20L30%2024%20L54%2030%20L30%2036%20Z%27%20fill%3D%27%23f2b73a%27%20opacity%3D%27.16%27/%3E%20%3Ccircle%20cx%3D%270%27%20cy%3D%270%27%20r%3D%272%27%20fill%3D%27%23f2b73a%27%20opacity%3D%27.35%27/%3E%3Ccircle%20cx%3D%2760%27%20cy%3D%2760%27%20r%3D%272%27%20fill%3D%27%23f2b73a%27%20opacity%3D%27.35%27/%3E%3Ccircle%20cx%3D%2760%27%20cy%3D%270%27%20r%3D%272%27%20fill%3D%27%23f2b73a%27%20opacity%3D%27.35%27/%3E%3Ccircle%20cx%3D%270%27%20cy%3D%2760%27%20r%3D%272%27%20fill%3D%27%23f2b73a%27%20opacity%3D%27.35%27/%3E%20%3C/svg%3E"); }
.felt {
  background:
    repeating-linear-gradient(92deg, rgba(0, 0, 0, 0.08) 0 2px, transparent 2px 9px, rgba(255, 255, 255, 0.03) 9px 11px, transparent 11px 23px),
    linear-gradient(180deg, #5a3519, #3a200d 60%, #2a1608);
}
.felt::before {
  content: '';
  position: absolute;
  inset: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  border-radius: 30px;
  background:
    radial-gradient(60% 45% at 50% 40%, rgba(255, 236, 190, 0.16), transparent 70%),
    var(--cloth-pattern),
    radial-gradient(130% 90% at 50% 40%, var(--felt), var(--felt-deep) 82%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06), inset 0 0 70px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.felt::after {
  content: '';
  position: absolute;
  inset: calc(max(8px, env(safe-area-inset-top)) + 9px) 17px calc(max(8px, env(safe-area-inset-bottom)) + 9px);
  border-radius: 23px;
  border: 2px dashed rgba(255, 255, 255, 0.13);
  pointer-events: none;
}
.felt.my-turn::after { border-color: rgba(242, 183, 58, 0.45); box-shadow: inset 0 -60px 60px -40px rgba(242, 183, 58, 0.18); }
.felt.shake { animation: tshake 0.42s ease; }
@keyframes tshake { 20% { transform: translate(-5px, 2px); } 40% { transform: translate(5px, -2px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, 0); } }

/* cards: bigger, they lift when touched and shake when they cannot go */
.card.mine .inner { transition: transform 0.18s ease; }
.card.mine:hover .inner, .card.mine:active .inner { transform: translateY(-10px); }
.card.mine .face { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); }
.card.nope .inner { animation: nope 0.35s ease; }
@keyframes nope { 20% { transform: translateX(-7px) rotate(-4deg); } 40% { transform: translateX(7px) rotate(4deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* card backs from the shop */
body[data-back='green'] .back { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 4px, transparent 4px 9px), #1e7a3a; }
body[data-back='gold'] .back { background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.08) 0 4px, transparent 4px 9px), linear-gradient(135deg, #f2c75a, #c48a1a); }
body[data-back='gold'] .back span { color: #4a2c00; }
body[data-back='ankara'] .back { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20width%3D%2728%27%20height%3D%2728%27%20viewBox%3D%270%200%2028%2028%27%3E%3Ccircle%20cx%3D%277%27%20cy%3D%277%27%20r%3D%275%27%20fill%3D%27%23f2b73a%27/%3E%3Ccircle%20cx%3D%277%27%20cy%3D%277%27%20r%3D%272.4%27%20fill%3D%27%231b4fa8%27/%3E%3Ccircle%20cx%3D%2721%27%20cy%3D%2721%27%20r%3D%275%27%20fill%3D%27%23e8702a%27/%3E%3Ccircle%20cx%3D%2721%27%20cy%3D%2721%27%20r%3D%272.4%27%20fill%3D%27%231b4fa8%27/%3E%3C/svg%3E"), #1b4fa8; background-size: calc(var(--cw) * 0.36); }
body[data-back='royal'] .back { background: repeating-linear-gradient(45deg, rgba(242, 183, 58, 0.18) 0 2px, transparent 2px 10px), #141414; border-color: #f2b73a; }
body[data-back='royal'] .back span { color: #f2b73a; }

/* faces round the table */
.avatar { width: 54px; height: 54px; padding: 0; background: transparent; overflow: visible; }
.avatar .face-holder { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.avatar .face-holder svg { width: 100%; height: 100%; display: block; }
.seat .timer { inset: -7px; -webkit-mask: radial-gradient(circle, transparent 31px, #000 32px); mask: radial-gradient(circle, transparent 31px, #000 32px); }
.seat.react .avatar { animation: react 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes react { 40% { transform: scale(1.18) rotate(-4deg); } }
.seat.me .name { display: none; }
.seat.me .avatar { width: 48px; height: 48px; }
.seat.me .flag { display: none; }
.seat .flag:not(.away) { animation: glowflag 1s ease-in-out infinite alternate; }
@keyframes glowflag { to { box-shadow: 0 0 12px rgba(242, 183, 58, 0.9); } }

/* stamps for the big moments */
.banner.stamp {
  display: flex; flex-direction: column; align-items: center; line-height: 0.9;
  padding: 10px 22px 12px; border-radius: 16px; border: 4px solid currentColor;
  text-shadow: none; background: rgba(14, 8, 6, 0.9); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%) scale(2) rotate(-12deg);
}
.banner.stamp.show { transform: translate(-50%, -50%) scale(1) rotate(-6deg); }
.banner.stamp small { font-size: 15px; letter-spacing: 3px; font-weight: 800; }
.banner.stamp b { font-size: 46px; font-weight: 800; letter-spacing: 1px; }
.banner.stamp.pick { color: #ff6b5a; }
.banner.stamp.hold { color: #f2b73a; }
.banner.stamp.sus { color: #7ab8ff; }
.banner.stamp.sus b, .banner.stamp.blocked b { font-size: 34px; }
.banner.stamp.market { color: #d9a6ff; }
.banner.stamp.market b { font-size: 38px; }
.banner.stamp.checkup { color: #7dffa8; }
.banner.stamp.last { color: #f2b73a; }
.banner.stamp.blocked { color: #fdf8ee; }
.banner.stamp.need { color: var(--cream); gap: 4px; }
.banner.stamp.need b { font-size: 30px; }
.shape-ring { width: 64px; height: 64px; border-radius: 50%; background: var(--cream); display: grid; place-items: center; animation: spin 0.6s ease-out; }
.shape-ring svg { width: 38px; height: 38px; fill: var(--maroon); }
@keyframes spin { from { transform: rotate(-360deg) scale(0.4); } }

/* confetti */
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 900; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall var(--d) cubic-bezier(0.3, 0.6, 0.6, 1) forwards; }
@keyframes fall { to { transform: translate(var(--x), 110vh) rotate(var(--r)); } }

/* my turn countdown when playing online */
.my-timer { position: absolute; left: 50%; transform: translateX(-50%); width: 130px; height: 7px; border-radius: 99px; background: rgba(0, 0, 0, 0.35); overflow: hidden; z-index: 210; pointer-events: none; }
.my-timer i { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; transition: transform 0.2s linear; }
.my-timer.low i { background: #ff6b5a; }
.my-timer[hidden] { display: none; }

/* ---------- home: coins, rank, today's challenge ---------- */
.profile-bar { display: flex; align-items: center; gap: 10px; }
.coins { display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, 0.3); border-radius: 99px; padding: 6px 12px 6px 6px; font-weight: 800; font-size: 16px; }
.coin { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe08a, #f2b73a 60%, #b07a10); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2); display: inline-grid; place-items: center; font-size: 12px; color: #6b4300; font-weight: 800; }
.rank { flex: 1; background: rgba(0, 0, 0, 0.3); border-radius: 14px; padding: 7px 12px; }
.rank b { display: block; font-size: 14px; }
.rank small { color: var(--muted); font-size: 12px; }
.rank .bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.15); margin-top: 5px; overflow: hidden; }
.rank .bar i { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.daily { background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.daily h4 { margin: 0; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.daily p { margin: 0; font-weight: 700; font-size: 15px; grid-column: 1; }
.daily .reward { grid-row: 1 / span 3; grid-column: 2; display: flex; align-items: center; gap: 5px; font-weight: 800; color: var(--gold); }
.daily .bar { grid-column: 1; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.daily .bar i { display: block; height: 100%; background: var(--gold); }
.daily.done { border-color: rgba(125, 255, 168, 0.5); }
.daily.done .reward { color: #7dffa8; }
.home-inner { gap: 18px; }
.logo-cards { height: 92px; }
.logo h1 { font-size: 40px; }

/* ---------- shop ---------- */
.shop-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: rgba(0, 0, 0, 0.25); border-radius: 14px; padding: 4px; }
.shop-tabs button { font: inherit; font-weight: 700; font-size: 13px; color: var(--muted); background: transparent; border: 0; border-radius: 10px; padding: 9px 2px; cursor: pointer; }
.shop-tabs button.on { background: var(--cream); color: var(--maroon); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; }
.item { font: inherit; color: var(--ink); background: rgba(255, 255, 255, 0.07); border: 2px solid transparent; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.item.on { border-color: var(--gold); }
.item b { font-size: 13px; text-align: center; }
.item small { font-size: 12px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.item .coin { width: 16px; height: 16px; font-size: 9px; }
.item .swatch { width: 100%; height: 60px; border-radius: 10px; }
.item .mini-back { width: 42px; height: 60px; border-radius: 6px; border: 3px solid var(--cream); }
.item .mini-face { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; }
.item .mini-face svg { width: 100%; height: 100%; display: block; }
.item .voice-ic { width: 60px; height: 60px; border-radius: 50%; background: rgba(0, 0, 0, 0.25); display: grid; place-items: center; }
.item .voice-ic svg { width: 26px; height: 26px; fill: var(--gold); }
.coin-line { text-align: center; font-weight: 800; color: var(--gold); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 18px; }
.coin-line[hidden] { display: none; }

.btn.reward-btn { background: #2fa24a; border-color: transparent; color: #fff; }
