/* ==========================================================================
   Powder Keg — styles. Mobile-first; cards scale with the viewport.
   ========================================================================== */

/* Luckiest Guy (SIL OFL), self-hosted. Split by unicode range like Google Fonts serves it. */
@font-face {
  font-family: 'Luckiest Guy';
  src: url('/fonts/luckiest-guy.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Luckiest Guy';
  src: url('/fonts/luckiest-guy-ext.woff2') format('woff2');
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg-0: #2a1208;
  --bg-1: #4a2110;
  --bg-2: #5c2a14;
  --sheet: #4f2613;
  --panel: rgba(38, 13, 3, 0.36);
  --panel-2: rgba(38, 13, 3, 0.58);
  --line: rgba(255, 214, 170, 0.2);
  --text: #fff4e4;
  --muted: #e6c8a8;
  --faint: #bd9773;
  --gold: #f4b23c;
  --gold-2: #c98410;
  --gold-ink: #3b2304;
  --teal: #2ec4b6;
  --teal-2: #138f84;
  --red: #ec4b3c;
  --red-2: #a8241a;
  --parch: #f7ecd2;
  --parch-2: #dcc591;
  --ink: #2a1d10;
  --display: 'Luckiest Guy', 'Trebuchet MS', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --cw: 80px; /* card width; any container can override it and cards inherit */
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background-color: var(--bg-1);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(ellipse 90% 70% at 50% 42%, rgba(255, 176, 96, 0.26), transparent 62%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(26, 7, 0, 0.45) 100%),
    repeating-linear-gradient(180deg, transparent 0 156px, rgba(38, 12, 2, 0.5) 156px 159px, rgba(255, 196, 140, 0.1) 159px 161px),
    linear-gradient(180deg, #a9562a 0%, #8c4322 100%);
  background-attachment: fixed;
}

body::before {
  /* wood grain: stretched fractal noise, stitched so it tiles */
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='320'%3E%3Cfilter id='g' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.005 .22' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .06 0 0 0 0 0 0 0 0 -1.6 .82'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  background-size: 640px 320px;
}

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

a {
  color: var(--teal);
}

input {
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 0;
  width: 100%;
}

input::placeholder {
  color: var(--faint);
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

h2,
h3 {
  font-family: var(--display);
  font-weight: normal;
  letter-spacing: 0.02em;
}

h3 {
  font-size: 1.15rem;
  color: var(--gold);
}

.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

.hint.bad {
  color: #ff9d8f;
}

.sub-h {
  margin: 12px 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}

kbd {
  font-family: ui-monospace, monospace;
  font-size: 0.7em;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 6px;
  opacity: 0.8;
}

@media (hover: none) {
  .btn kbd {
    display: none;
  }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 0;
  border-radius: 14px;
  padding: 0.75em 1.2em 0.65em;
  color: var(--gold-ink);
  background: var(--gold);
  background: linear-gradient(#ffd27a, var(--gold));
  box-shadow: 0 4px 0 var(--gold-2), 0 8px 18px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--gold-2), 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn:disabled {
  filter: grayscale(0.75) brightness(0.7);
  cursor: not-allowed;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn.big {
  font-size: 1.3rem;
  width: 100%;
  padding: 0.8em 1.2em 0.7em;
}

.btn.wide {
  width: 100%;
  margin-top: 14px;
}

.btn.secondary {
  background: linear-gradient(#55dccf, var(--teal));
  color: #04302b;
  box-shadow: 0 4px 0 var(--teal-2), 0 8px 18px rgba(0, 0, 0, 0.3);
}

.btn.secondary:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--teal-2), 0 4px 10px rgba(0, 0, 0, 0.3);
}

.btn.nope {
  background: linear-gradient(#ff7d6e, var(--red));
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
  box-shadow: 0 4px 0 var(--red-2), 0 0 0 0 rgba(236, 75, 60, 0.6);
  animation: nope-pulse 1s ease-in-out infinite;
}

.btn.nope img {
  width: 1.4em;
  height: 1.4em;
}

.btn.ghost {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: none;
  font-family: var(--body);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.btn.small {
  font-size: 0.85rem;
  padding: 0.55em 0.9em;
}

.btn.gold-outline {
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  box-shadow: none;
  text-transform: none;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  border: 0;
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
}

.icon-btn:hover:not(:disabled) {
  background: var(--panel-2);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.icon-btn.danger {
  color: #ff9d8f;
  width: 34px;
  height: 34px;
}

.icon-btn .dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.link {
  background: none;
  border: 0;
  padding: 4px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link .icon {
  width: 16px;
  height: 16px;
}

.link.small {
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------- generic screen bits */

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(14px + var(--safe-t)) calc(16px + var(--safe-r)) calc(28px + var(--safe-b)) calc(16px + var(--safe-l));
  position: relative;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.panel h3 {
  margin-bottom: 10px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.panel-head h3 {
  margin: 0;
}

.count {
  font-family: var(--body);
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--faint);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--gold);
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
}

.topbar-title small {
  font-family: var(--body);
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title .mono {
  font-family: var(--display);
  letter-spacing: 0.12em;
}

/* ---------------------------------------------------------------- boot / home */

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.hero {
  text-align: center;
  padding-top: 4px;
}

.hero-keg {
  width: 104px;
  height: 104px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
}

.hero-keg,
.bob {
  animation: bob 3s ease-in-out infinite;
}

.logo {
  font-family: var(--display);
  font-weight: normal;
  font-size: clamp(2.8rem, 13vw, 4rem);
  line-height: 0.92;
  margin: 4px 0 6px;
  color: var(--gold);
  text-shadow: 0 4px 0 #8a4f06, 0 10px 24px rgba(0, 0, 0, 0.55);
  letter-spacing: 0.02em;
}

.logo span {
  display: inline-block;
}

.logo span:last-child {
  color: #ff8a5c;
  text-shadow: 0 4px 0 #8a2a10, 0 10px 24px rgba(0, 0, 0, 0.55);
}

.logo.small {
  font-size: 2.2rem;
}

.tagline {
  color: var(--muted);
  margin: 0;
}

.home {
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.invite-panel {
  text-align: center;
  border-color: var(--gold);
  background: rgba(244, 178, 60, 0.1);
}

.invite-panel p {
  margin: 0 0 10px;
}

.join-row {
  display: flex;
  gap: 8px;
}

.code-input {
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
  padding: 8px 6px 4px;
  flex: 1;
}

.home-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.credits {
  text-align: center;
  color: var(--faint);
  font-size: 0.8rem;
}

/* ---------------------------------------------------------------- profile */

.profile-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.avatar-btn {
  position: relative;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
}

.edit-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--gold-ink);
  display: grid;
  place-items: center;
}

.edit-dot .icon {
  width: 12px;
  height: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field > span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 800;
}

.grow {
  flex: 1;
  min-width: 0;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.avatar-choice {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  background: rgba(0, 0, 0, 0.22);
  padding: 8px;
  cursor: pointer;
}

.avatar-choice.on {
  border-color: var(--gold);
  background: rgba(244, 178, 60, 0.2);
}

.avatar-choice img {
  width: 100%;
  height: 100%;
  display: block;
}

.avatar {
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b97a45, #6b3a1c);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16) inset, 0 3px 8px rgba(0, 0, 0, 0.3);
}

.avatar img {
  width: 66%;
  height: 66%;
  display: block;
}

/* ---------------------------------------------------------------- signal */

.signal {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  flex: none;
  padding: 0 2px;
}

.signal i {
  display: block;
  width: 4px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.2);
}

.signal i:nth-child(1) {
  height: 5px;
}

.signal i:nth-child(2) {
  height: 9px;
}

.signal i:nth-child(3) {
  height: 13px;
}

.signal.s3 i {
  background: #4ade80;
}

.signal.s2 i:nth-child(-n + 2) {
  background: #facc15;
}

.signal.s1 i:nth-child(1) {
  background: #f87171;
}

.signal.s0 i {
  background: rgba(248, 113, 113, 0.35);
}

/* ---------------------------------------------------------------- cards */

.card {
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  border-radius: calc(var(--cw) * 0.12);
  background: #fff;
  border: max(2px, calc(var(--cw) * 0.05)) solid var(--c, #555);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.28), 0 6px 14px rgba(0, 0, 0, 0.35);
  position: relative;
  color: #1d1410;
  flex: none;
  font-size: calc(var(--cw) * 0.125);
  user-select: none;
  -webkit-user-select: none;
  text-align: left;
  overflow: hidden;
}

.card-in {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(#fff 40%, color-mix(in srgb, var(--c) 18%, #fff));
}

.card-head {
  flex: none;
  padding: 0.5em 0.5em 0;
  min-height: 2.75em;
}

.card-tag {
  font-family: var(--display);
  font-size: 0.6em;
  line-height: 1;
  color: var(--c);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  font-family: var(--display);
  font-size: var(--title-size, 1em);
  line-height: 0.95;
  margin-top: 0.12em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.card-art {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle closest-side at 50% 52%, color-mix(in srgb, var(--c) 24%, #fff) 0 94%, transparent 96%);
}

.card-art img {
  width: 74%;
  max-height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 calc(var(--cw) * 0.03) 0 rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.card-text {
  display: none;
}

.card.with-text .card-art img {
  width: 48%;
  max-height: none;
}

.card.with-text .card-text {
  flex: none;
  display: block;
  font-size: 0.6em;
  line-height: 1.3;
  font-weight: 650;
  padding: 0.2em 0.8em 0.8em;
  color: #3d2c22;
}

/* crew cards get a full-colour picture panel */
.card.k-crew .card-art {
  margin: 0 0.4em 0.4em;
  border-radius: calc(var(--cw) * 0.07);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 62%, #fff), var(--c));
}

.card.k-keg {
  border-color: #ef3340;
  color: #fff;
  box-shadow: 0 0 calc(var(--cw) * 0.16) rgba(255, 90, 54, 0.6), 0 6px 14px rgba(0, 0, 0, 0.4);
}

.card.k-keg .card-in {
  background: radial-gradient(circle at 50% 62%, #8a2414, #1d0a07 78%);
}

.card.k-keg .card-tag {
  color: #ffb23c;
}

.card.k-keg .card-art {
  background: none;
}

.card.k-keg .card-art img {
  width: 80%;
  animation: keg-wobble 1.4s ease-in-out infinite;
}

.card.k-keg.with-text .card-text {
  color: #ffe9d6;
}

.card.back {
  border-color: #ff6a4d;
  background: #d81e33;
}

.card.back .card-in {
  background: radial-gradient(circle at 50% 46%, #f5503c, #c3142c 72%);
  display: grid;
  place-items: center;
}

.back-emblem {
  width: 64%;
  aspect-ratio: 1;
  background: linear-gradient(#ffc64d, #ff6a2b);
  -webkit-mask: url('/art/keg.svg') center / contain no-repeat;
  mask: url('/art/keg.svg') center / contain no-repeat;
  filter: drop-shadow(0 calc(var(--cw) * 0.02) 0 rgba(90, 0, 10, 0.5));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px 0 3px;
  border-radius: 99px;
  background: var(--c);
  color: #fff;
  font-weight: 700;
  font-size: 0.85em;
  line-height: 1.55;
  vertical-align: middle;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.chip img {
  width: 1.15em;
  height: 1.15em;
}

.mini-back {
  display: inline-block;
  width: 11px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(160deg, #f5503c, #c3142c);
  border: 1px solid #ff9a6b;
  margin-right: 4px;
  vertical-align: -2px;
}

/* ---------------------------------------------------------------- lobby */

.lobby {
  max-width: 1120px;
  padding-bottom: calc(130px + var(--safe-b));
}

.lobby .topbar {
  padding: 0 0 10px;
}

.lobby-grid {
  display: grid;
  gap: 14px;
}

.lobby-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

@media (min-width: 900px) {
  .lobby-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: start;
  }
}

.code-panel {
  text-align: center;
}

.code-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 800;
}

.room-code {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 8px 0 14px;
}

.room-code span {
  font-family: var(--display);
  font-size: clamp(1.7rem, 9vw, 2.3rem);
  width: 1.55em;
  height: 1.8em;
  padding-top: 0.12em;
  display: grid;
  place-items: center;
  background: var(--parch);
  color: var(--ink);
  border-radius: 10px;
  box-shadow: 0 4px 0 var(--parch-2), 0 8px 16px rgba(0, 0, 0, 0.35);
}

.code-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.code-actions .btn {
  flex: 1;
  max-width: 200px;
  font-size: 0.9rem;
}

.edit-me {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.members {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
}

.member.me {
  box-shadow: inset 0 0 0 1px rgba(46, 196, 182, 0.55);
}

.member.away {
  opacity: 0.55;
}

.member-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
}

.member-name b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-name small {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--panel-2);
  padding: 1px 7px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.member-name small.captain {
  color: var(--gold);
}

.member-name small .icon {
  width: 11px;
  height: 11px;
}

.deck-list {
  display: grid;
  gap: 8px;
}

.deck-opt {
  display: flex;
  align-items: stretch;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 2px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.deck-opt.on {
  border-color: var(--gold);
  background: rgba(244, 178, 60, 0.12);
}

.deck-main {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
  color: var(--text);
}

.deck-main:disabled {
  cursor: default;
  color: var(--text);
}

.deck-icon {
  width: 40px;
  height: 40px;
  flex: none;
}

.deck-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.deck-name {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.deck-opt.on .deck-name {
  color: var(--gold);
}

.deck-players {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--panel-2);
  padding: 1px 7px;
  border-radius: 99px;
  margin-left: 4px;
  vertical-align: 2px;
  color: var(--text);
}

.deck-opt.nofit .deck-players {
  background: rgba(236, 75, 60, 0.35);
}

.deck-blurb {
  color: var(--muted);
  font-size: 0.85rem;
}

.deck-specials {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}

.deck-specials img {
  width: 18px;
  height: 18px;
}

.deck-view {
  padding: 0 10px;
  white-space: nowrap;
}

.custom-deck {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.custom-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.custom-head label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}

.custom-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}

.custom-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 10px;
}

.custom-list img {
  width: 24px;
  height: 24px;
}

.custom-name {
  flex: 1;
  font-size: 0.9rem;
}

.custom-deck .hint {
  margin-top: 10px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 2px;
}

.stepper button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: var(--panel-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}

.stepper .icon {
  width: 14px;
  height: 14px;
}

.stepper output {
  min-width: 26px;
  text-align: center;
  font-weight: 800;
}

.setting + .setting {
  margin-top: 14px;
}

.setting-label {
  font-weight: 700;
  margin-bottom: 6px;
}

.setting-label small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 7px 13px;
  border-radius: 99px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip-btn .icon {
  width: 15px;
  height: 15px;
}

.chip-btn.on {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
}

.chip-btn:disabled {
  cursor: default;
}

.chip-btn:disabled:not(.on) {
  opacity: 0.5;
}

.start-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 26px calc(16px + var(--safe-r)) calc(12px + var(--safe-b)) calc(16px + var(--safe-l));
  background: linear-gradient(rgba(40, 18, 8, 0), rgba(40, 18, 8, 0.94) 32%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.start-bar > * {
  pointer-events: auto;
}

.start-bar .btn {
  max-width: 440px;
}

.waiting {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--gold);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}

.dots i {
  font-style: normal;
  animation: dot 1.4s infinite;
}

.dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.dots i:nth-child(3) {
  animation-delay: 0.4s;
}

/* ---------------------------------------------------------------- chat */

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.chat-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  overscroll-behavior: contain;
}

.lobby-chat .chat-list {
  max-height: 240px;
}

.chat-empty {
  color: var(--faint);
  text-align: center;
  margin: auto 0;
  font-size: 0.85rem;
}

.chat-msg {
  background: var(--panel-2);
  padding: 6px 10px;
  border-radius: 12px 12px 12px 4px;
  align-self: flex-start;
  max-width: 92%;
  overflow-wrap: anywhere;
}

.chat-msg.mine {
  align-self: flex-end;
  background: rgba(46, 196, 182, 0.25);
  border-radius: 12px 12px 4px 12px;
}

.chat-msg b {
  color: var(--gold);
  margin-right: 4px;
}

.chat-sys {
  font-size: 0.78rem;
  color: var(--faint);
  text-align: center;
  font-style: italic;
}

.log-line {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.log-line b {
  color: var(--text);
}

.log-line.tone-turn {
  font-size: 0.75rem;
  color: var(--faint);
  border-top: 1px dashed var(--line);
  padding-top: 5px;
  margin-top: 2px;
}

.log-line.tone-big {
  color: var(--gold);
  font-weight: 700;
}

.log-line.tone-good {
  color: #9be7c4;
}

.log-line.tone-bad {
  color: #ffb4a8;
}

.emote-bar {
  display: flex;
  gap: 4px;
  padding: 6px 0;
  justify-content: space-between;
}

.emote-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: var(--panel);
  padding: 6px;
  cursor: pointer;
  transition: transform 0.1s;
}

.emote-btn:active {
  transform: scale(0.88);
}

.emote-btn img {
  width: 100%;
  height: 100%;
  display: block;
}

.chat-form {
  display: flex;
  gap: 6px;
  padding-top: 4px;
}

.chat-form input {
  flex: 1;
}

/* ---------------------------------------------------------------- game table */

.table-screen {
  position: fixed;
  inset: 0;
  display: flex;
  overflow: hidden;
}

.table {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--safe-t) var(--safe-r) 0 var(--safe-l);
}

.opponents {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
}

.turn-dir {
  flex: none;
  font-family: var(--display);
  color: var(--gold);
  font-size: 1.2rem;
  width: 18px;
  text-align: center;
  opacity: 0.8;
}

.seats {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 18px 4px 4px;
}

.seats::-webkit-scrollbar {
  display: none;
}

.seats > :first-child {
  margin-left: auto;
}

.seats > :last-child {
  margin-right: auto;
}

.seat {
  flex: none;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 4px 5px;
  border-radius: 14px;
  background: var(--panel);
  position: relative;
  transition: background 0.25s, box-shadow 0.25s, opacity 0.25s;
}

.seat.current {
  background: rgba(244, 178, 60, 0.18);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.seat.targeted {
  box-shadow: inset 0 0 0 2px var(--red);
}

.seat.out {
  opacity: 0.5;
}

.seat.out .avatar {
  filter: grayscale(1);
}

.seat.away .avatar {
  opacity: 0.55;
}

.seat-av {
  position: relative;
}

.seat-x {
  position: absolute;
  inset: 8%;
  width: 84%;
  height: 84%;
}

.seat-name {
  font-weight: 800;
  font-size: 0.78rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.seat-cards {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.badge {
  position: absolute;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.badge.turns {
  top: -6px;
  right: -10px;
  background: var(--red);
  color: #fff;
}

.badge.away {
  bottom: -4px;
  right: -8px;
  background: #5a2a1a;
  color: #ffb4a8;
}

.badge.away .icon {
  width: 12px;
  height: 12px;
}

.ring {
  position: absolute;
  inset: -5px;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  transform: rotate(-90deg);
  pointer-events: none;
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 3;
}

.ring-fg {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear;
}

.ring.urgent .ring-fg {
  stroke: var(--red);
}

.emote-pop {
  position: absolute;
  left: 50%;
  top: -20px;
  width: 36px;
  height: 36px;
  z-index: 6;
  pointer-events: none;
  animation: emote 2.6s ease-out forwards;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
}

.center {
  flex: 1;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  position: relative;
  padding: 4px 12px 8px;
}

.status {
  color: var(--muted);
  font-size: 0.98rem;
  text-align: center;
  min-height: 1.4em;
}

.status b {
  color: var(--text);
}

.status.mine b {
  color: var(--gold);
  font-family: var(--display);
  font-weight: normal;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.status.waiting-on {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  width: min(360px, 100%);
}

.piles {
  --cw: clamp(68px, min(24vw, 14vh), 124px);
  display: flex;
  gap: clamp(22px, 8vw, 54px);
  align-items: center;
}

.pile {
  position: relative;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: calc(var(--cw) * 0.1);
}

.pile:disabled {
  cursor: default;
}


.pile .stack {
  display: block;
  position: relative;
  isolation: isolate;
}

.pile .stack::before,
.pile .stack::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cw) * 0.1);
  background: #7d0c1c;
  border: 1px solid rgba(244, 178, 60, 0.45);
  z-index: -1;
}

.pile .stack::before {
  transform: translate(3px, 3px);
}

.pile .stack::after {
  transform: translate(6px, 6px);
}

.pile-count {
  position: absolute;
  top: -9px;
  right: -9px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 13px;
  background: var(--parch);
  color: var(--ink);
  font-weight: 900;
  font-size: 0.82rem;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.keg-count {
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  background: #3b1712;
  color: #ffcf8a;
  border: 1px solid #ff8a5c;
  border-radius: 99px;
  padding: 1px 8px 1px 3px;
  font-weight: 900;
  font-size: 0.82rem;
  white-space: nowrap;
  z-index: 2;
}

.keg-count img {
  width: 18px;
  height: 18px;
}

.pile.deck.can-draw .stack > .card {
  box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(244, 178, 60, 0.65);
  animation: breathe 1.6s ease-in-out infinite;
}

.pile-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-size: calc(var(--cw) * 0.2);
  color: var(--gold);
  background: rgba(48, 20, 8, 0.88);
  padding: 0.2em 0.5em 0.05em;
  border-radius: 8px;
  pointer-events: none;
  letter-spacing: 0.04em;
}

.empty-slot {
  display: grid;
  place-items: center;
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  border: 2px dashed var(--line);
  border-radius: calc(var(--cw) * 0.1);
  color: var(--faint);
  font-size: 0.8rem;
}

.pending {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: min(460px, calc(100% - 16px));
  background: rgba(52, 23, 10, 0.97);
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 10px 12px 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 6;
  animation: pop-in 0.18s ease-out;
}

.pending.is-cancelled {
  border-color: var(--red);
}

.pending-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.pending-cards {
  display: flex;
  gap: 3px;
}

.mini-card {
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
}

.mini-card .card {
  --cw: 38px;
}

.pending .arrow {
  color: var(--gold);
  font-weight: 900;
}

.pending-desc {
  color: var(--muted);
  font-size: 0.9rem;
}

.nope-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 0.82rem;
}

.nope-chip {
  background: rgba(236, 75, 60, 0.25);
  border: 1px solid rgba(236, 75, 60, 0.6);
  padding: 1px 8px;
  border-radius: 99px;
}

.nope-chain b.bad {
  color: #ff9d8f;
}

.nope-chain b.good {
  color: #9be7c4;
}

.pending-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pending-actions .btn.nope {
  flex: 1;
}

.pending-actions .btn.ghost {
  margin-left: auto;
}

.ticker {
  flex: none;
  margin: 0 10px 4px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-size: 0.84rem;
  text-align: left;
  border: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  animation: ticker-in 0.3s ease-out;
}

.ticker b {
  color: var(--text);
}

.me-area {
  flex: none;
  position: relative;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.28));
  border-top: 1px solid var(--line);
  transition: background 0.3s;
}

.me-area.my-turn {
  background: linear-gradient(rgba(244, 178, 60, 0.04), rgba(244, 178, 60, 0.14));
  border-top-color: rgba(244, 178, 60, 0.45);
}

.action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 0;
  min-height: 58px;
  position: relative;
}

.action-bar > .hint {
  flex: 1;
  text-align: center;
}

.sel-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.3;
}

.sel-info b {
  color: var(--gold);
  font-family: var(--display);
  font-weight: normal;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.sel-info.bad b {
  color: #ff9d8f;
}

.bar-buttons {
  display: flex;
  gap: 6px;
  flex: none;
}

.draw-btn {
  min-width: 110px;
}

.timebar.turn-timer {
  position: absolute;
  left: 12px;
  right: 12px;
  top: -9px;
  height: 6px !important;
}

.turn-timer .timebar-label {
  display: none;
}

.hand {
  --cw: clamp(62px, min(20.5vw, 13vh), 112px);
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 24px 12px calc(12px + var(--safe-b));
  scrollbar-width: none;
}

.hand::-webkit-scrollbar {
  display: none;
}

.hand-card {
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: calc(var(--cw) * 0.1);
  transition: transform 0.15s ease-out, margin 0.2s;
  position: relative;
}


.hand-card:first-child {
  margin-left: auto;
}

.hand-card:last-child {
  margin-right: auto;
}

.hand-card + .hand-card {
  margin-left: var(--overlap, 0px);
}

.hand-card:disabled {
  cursor: default;
}

.hand-card.sel {
  /* lift only: raising z-index would cover the neighbour you need to tap for a pair */
  transform: translateY(-18px);
}

.hand-card.sel .card {
  box-shadow: 0 0 0 3px var(--gold), 0 12px 22px rgba(0, 0, 0, 0.5);
}

.hand-card.glow .card {
  animation: glow 0.85s ease-in-out infinite alternate;
}

@media (hover: hover) {
  .hand-card:hover:not(.sel):not(:disabled) {
    transform: translateY(-8px);
  }
}

.hand-empty {
  margin: 20px auto;
  color: var(--faint);
}

.my-emotes {
  position: absolute;
  left: 50%;
  top: 0;
  width: 0;
  height: 0;
}

.my-emotes .emote-pop {
  top: -46px;
}

/* chat side panel / drawer */
.side {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  width: min(380px, 92vw);
  display: flex;
  flex-direction: column;
  background: #43200f;
  border-left: 1px solid var(--line);
  padding: calc(8px + var(--safe-t)) calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) 12px;
  transform: translateX(105%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
}

.drawer-open .side {
  transform: none;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.side-head h3 {
  margin: 0;
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 54;
  background: rgba(24, 9, 3, 0.5);
  animation: fade 0.2s;
}

/* game over */
.gameover {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(24, 9, 3, 0.74);
  animation: fade 0.35s;
}

.gameover-card {
  width: min(420px, 100%);
  max-height: 92dvh;
  overflow: auto;
  background: var(--sheet);
  border: 2px solid var(--gold);
  border-radius: 22px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: pop-in 0.3s ease-out;
}

.gameover-card h2 {
  font-size: 2rem;
  color: var(--gold);
}

.gameover-card .sub {
  margin: 0;
  color: var(--muted);
}

.trophy {
  width: 76px;
  height: 76px;
  margin: 0 auto;
  animation: bob 2.2s ease-in-out infinite;
}

.standings {
  list-style: none;
  padding: 0;
  margin: 4px 0;
  display: grid;
  gap: 4px;
  text-align: left;
}

.standings li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.standings li.me {
  box-shadow: inset 0 0 0 1px rgba(46, 196, 182, 0.6);
}

.standings .place {
  font-family: var(--display);
  color: var(--gold);
  width: 20px;
  text-align: center;
}

.standings .nm {
  flex: 1;
  font-weight: 700;
}

/* ---------------------------------------------------------------- timers */

.timebar {
  position: relative;
  width: 100%;
  height: 16px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  flex: none;
}

.timebar.slim {
  height: 6px;
}

.timebar.slim .timebar-label {
  display: none;
}

.timebar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transform-origin: left center;
  transition: transform 0.2s linear;
}

.timebar.urgent .timebar-fill {
  background: var(--red);
}

.timebar-label {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* ---------------------------------------------------------------- sheets / modals */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(24, 9, 3, 0.62);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.15s;
}

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  background: var(--sheet);
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
  padding-bottom: var(--safe-b);
  animation: slide-up 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 700px) {
  .sheet-backdrop {
    align-items: center;
    padding: 20px;
  }

  .sheet {
    border-radius: 22px;
    border-bottom: 1px solid var(--line);
    animation: pop-in 0.2s ease-out;
  }

  .sheet.wide {
    max-width: 780px;
  }
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 8px;
}

.sheet-head h2 {
  font-size: 1.5rem;
  color: var(--gold);
}

.sheet-head .sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.sheet-body {
  overflow: auto;
  padding: 6px 16px 16px;
  overscroll-behavior: contain;
}

.sheet-foot {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.foot-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.foot-row .hint {
  flex: 1;
}

.prompt-sheet .sheet-head h2 {
  font-size: 1.6rem;
}

.card-grid {
  --cw: 78px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--cw) + 4px), 1fr));
  gap: 12px 8px;
  justify-items: center;
  padding-top: 8px;
}

.card-grid.small {
  --cw: 64px;
}

.grid-card {
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: calc(var(--cw) * 0.1);
  transition: transform 0.12s;
}


.grid-card.static {
  cursor: default;
}

.grid-card.sel {
  transform: translateY(-6px);
}

.grid-card.sel .card {
  box-shadow: 0 0 0 3px var(--gold), 0 10px 20px rgba(0, 0, 0, 0.5);
}

.target-list {
  display: grid;
  gap: 8px;
}

.target {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  text-align: left;
}

.target:hover:not(:disabled) {
  background: rgba(244, 178, 60, 0.14);
  border-color: var(--gold);
}

.target:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.t-name {
  flex: 1;
  font-weight: 800;
  font-size: 1.05rem;
}

.t-cards {
  color: var(--muted);
  font-weight: 700;
}

.place {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.place-label {
  font-size: 1rem;
}

.place-label b {
  color: var(--gold);
}

.inline-art {
  width: 1.4em;
  height: 1.4em;
  vertical-align: -0.35em;
}

.deck-strip {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 48px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  overflow: hidden;
}

.deck-strip i {
  flex: 1;
  min-width: 2px;
  max-width: 14px;
  height: 30px;
  border-radius: 2px;
  background: linear-gradient(#8a4a24, #5c2a14);
  border: 1px solid rgba(244, 178, 60, 0.4);
}

.strip-mark {
  width: 32px;
  height: 32px;
  flex: none;
  filter: drop-shadow(0 0 6px #ff8a1c);
}

.strip-end {
  font-size: 0.65rem;
  color: var(--faint);
  text-transform: uppercase;
  font-weight: 800;
  flex: none;
}

input[type='range'] {
  width: 100%;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  accent-color: var(--gold);
}

.bury-card {
  --cw: 110px;
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.arrange,
.peek-row {
  --cw: clamp(76px, 24vw, 104px);
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 6px;
}

.arrange-slot,
.peek-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.slot-n {
  font-family: var(--display);
  color: var(--gold);
}

.slot-moves {
  display: flex;
  gap: 6px;
}

.card-zoom {
  --cw: min(220px, 56vw);
  display: flex;
  justify-content: center;
  padding: 6px 0 10px;
}

.discard-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.deck-contents {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.deck-contents li {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(0, 0, 0, 0.16);
  border-radius: 12px;
  padding: 8px;
}

.dc-card {
  --cw: 50px;
  flex: none;
}


.dc-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
  color: var(--muted);
}

.dc-text b {
  color: var(--text);
  font-size: 0.95rem;
}

.deck-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.deck-summary li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 0.9rem;
}

.deck-summary img {
  width: 36px;
  height: 36px;
  flex: none;
}

.deck-summary b {
  color: var(--text);
  font-family: var(--display);
  font-weight: normal;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.tab {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 99px;
  padding: 6px 14px;
  font-weight: 800;
  cursor: pointer;
}

.tab.on {
  background: var(--gold);
  color: var(--gold-ink);
  border-color: var(--gold);
}

.rules-text {
  line-height: 1.55;
  color: #f1dcc4;
}

.rules-text .lead {
  font-size: 1.02rem;
}

.rules-text h4 {
  font-family: var(--display);
  font-weight: normal;
  color: var(--gold);
  letter-spacing: 0.03em;
  font-size: 1.1rem;
  margin: 16px 0 4px;
}

.rules-text ol,
.rules-text ul {
  padding-left: 1.3em;
  margin: 4px 0;
}

/* ---------------------------------------------------------------- banners, toasts, fx */

.conn-banner {
  position: fixed;
  top: calc(var(--safe-t) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #8a2f14;
  color: #fff;
  padding: 8px 16px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.88rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  max-width: calc(100vw - 20px);
  animation: pop-in 0.2s;
}

.conn-banner small {
  font-weight: 500;
  opacity: 0.85;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  flex: none;
}

.toasts {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-t) + 58px);
  transform: translateX(-50%);
  z-index: 95;
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #6e3519;
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 650;
  font-size: 0.92rem;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.22s ease-out;
}

.toast.bad {
  background: #7d2318;
}

.toast.good {
  background: #126353;
}

.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  overflow: hidden;
}

.card.flying {
  position: fixed;
  z-index: 3;
  will-change: transform, opacity;
}

.fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.fx-flash {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.fx-banner {
  position: fixed;
  left: 50%;
  top: 40%;
  z-index: 4;
  font-family: var(--display);
  font-size: clamp(2.2rem, 11vw, 4.6rem);
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 34px rgba(0, 0, 0, 0.55);
  letter-spacing: 0.02em;
}

.fx-banner.tone-danger {
  color: #ffd25a;
  text-shadow: 0 4px 0 #8a1c10, 0 0 30px rgba(255, 90, 30, 0.7);
}

.fx-banner.tone-nope {
  color: #fff;
  background: var(--red);
  padding: 0.15em 0.45em 0.02em;
  border-radius: 14px;
  border: 5px solid #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  font-size: clamp(1.8rem, 9vw, 3.4rem);
}

.fx-banner.tone-water {
  color: #c9f3ff;
  text-shadow: 0 4px 0 #0e5a8a, 0 0 30px rgba(80, 200, 255, 0.6);
}

.fx-banner.tone-gold {
  color: var(--gold);
  text-shadow: 0 4px 0 #8a4f06, 0 0 30px rgba(255, 200, 80, 0.6);
}

.fx-bubble {
  position: fixed;
  z-index: 4;
  font-family: var(--display);
  font-size: 1.3rem;
  color: #fff;
  padding: 0.18em 0.6em 0.02em;
  border-radius: 99px;
  background: var(--teal-2);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.fx-bubble.tone-danger,
.fx-bubble.tone-nope {
  background: var(--red);
}

/* ---------------------------------------------------------------- larger screens */

@media (min-width: 700px) {
  .seat {
    width: 90px;
  }

  .seat-name {
    font-size: 0.86rem;
  }

  .center {
    gap: 18px;
  }
}

@media (min-width: 1000px) {
  .side {
    position: relative;
    transform: none;
    width: 340px;
    flex: none;
    box-shadow: none;
    z-index: 1;
    background: rgba(40, 16, 6, 0.45);
  }

  .chat-toggle,
  .drawer-close,
  .drawer-scrim,
  .ticker {
    display: none !important;
  }

  .hand {
    --cw: clamp(80px, 14dvh, 118px);
  }
}

/* landscape phones: squeeze vertically */
@media (max-height: 560px) and (orientation: landscape) {
  .topbar {
    padding: 4px 8px;
  }

  .seats {
    padding-top: 12px;
  }

  .seat {
    width: 66px;
    padding: 4px 3px 3px;
  }

  .seat .avatar {
    --size: 32px !important;
  }

  .seat-name,
  .seat-cards {
    font-size: 0.7rem;
  }

  .ticker {
    display: none;
  }

  .center {
    flex-direction: row;
    gap: 18px;
    padding-top: 2px;
  }

  .piles {
    --cw: clamp(52px, 17dvh, 86px);
  }

  .status {
    max-width: 30%;
  }

  .action-bar {
    min-height: 46px;
    padding-top: 4px;
  }

  .hand {
    --cw: clamp(52px, 18dvh, 88px);
    padding-top: 18px;
    padding-bottom: calc(6px + var(--safe-b));
  }

  .pending {
    width: min(520px, calc(100% - 16px));
  }
}

/* ---------------------------------------------------------------- adaptive sizing */

@supports (height: 1dvh) {
  .hand {
    --cw: clamp(62px, min(20.5vw, 13dvh), 112px);
  }
}

/* Size the piles from the space the center area really has, so nothing can overflow it. */
@supports (width: 1cqh) {
  .center {
    container-type: size;
  }

  .piles {
    --cw: clamp(52px, min(25vw, 36cqh), 132px);
  }
}

.sel-info > span:not(.sel-title) {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sel-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  flex: none;
}

.info-btn .icon {
  width: 14px;
  height: 14px;
}

/* Phones: crew, deck and rules first; the chat goes last. */
@media (max-width: 899px) {
  .lobby-col {
    display: contents;
  }

  .lobby-grid > .lobby-col > .code-panel,
  .lobby-grid .code-panel {
    order: 1;
  }

  .lobby-grid .crew-panel {
    order: 2;
  }

  .lobby-grid .deck-panel {
    order: 3;
  }

  .lobby-grid .rules-panel {
    order: 4;
  }

  .lobby-grid .lobby-chat {
    order: 5;
  }
}

/* Big tables (5+ opponents): compact seats that wrap, so everyone stays visible. */
.seats.crowded {
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  overflow: visible;
  padding-top: 14px;
}

.seats.crowded > :first-child,
.seats.crowded > :last-child {
  margin: 0;
}

.seats.crowded .seat {
  width: 62px;
  padding: 5px 2px 3px;
  border-radius: 12px;
}

.seats.crowded .seat .avatar {
  --size: 34px !important;
}

.seats.crowded .seat-name {
  font-size: 0.7rem;
}

.seats.crowded .seat-cards {
  font-size: 0.68rem;
}

.seats.crowded .emote-pop {
  width: 28px;
  height: 28px;
  top: -14px;
}

@media (min-width: 700px) {
  .seats.crowded .seat {
    width: 84px;
  }

  .seats.crowded .seat .avatar {
    --size: 40px !important;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .seats.crowded {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-top: 10px;
  }

  .seats.crowded > :first-child {
    margin-left: auto;
  }

  .seats.crowded > :last-child {
    margin-right: auto;
  }

  /* compact reaction banner so it doesn't bury the table */
  .pending {
    gap: 4px;
    padding: 6px 10px 8px;
    bottom: 2px;
  }

  .pending-desc {
    display: none;
  }

  .pending .mini-card .card {
    --cw: 26px;
  }

  .pending .btn.nope.big {
    font-size: 1.05rem;
    padding: 0.45em 1em 0.35em;
  }

  .pending .timebar {
    height: 10px;
  }

  .pending .timebar-label {
    display: none;
  }
}

/* ---------------------------------------------------------------- animations */

@keyframes bob {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes glow {
  from {
    box-shadow: 0 0 0 2px rgba(236, 75, 60, 0.6), 0 0 10px rgba(236, 75, 60, 0.4);
  }
  to {
    box-shadow: 0 0 0 3px #ff7d6e, 0 0 24px rgba(236, 75, 60, 0.9);
  }
}

@keyframes nope-pulse {
  0%,
  100% {
    box-shadow: 0 4px 0 var(--red-2), 0 0 0 0 rgba(236, 75, 60, 0.55);
  }
  50% {
    box-shadow: 0 4px 0 var(--red-2), 0 0 0 8px rgba(236, 75, 60, 0);
  }
}

@keyframes keg-wobble {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(4deg) scale(1.04);
  }
}

@keyframes emote {
  0% {
    transform: translate(-50%, 10px) scale(0.3);
    opacity: 0;
  }
  12% {
    transform: translate(-50%, -8px) scale(1.25);
    opacity: 1;
  }
  22% {
    transform: translate(-50%, 0) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -34px) scale(0.9);
    opacity: 0;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes slide-up {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

@keyframes pop-in {
  from {
    transform: scale(0.94);
    opacity: 0;
  }
}

.pending {
  animation-name: pending-in;
}

@keyframes pending-in {
  from {
    transform: translateX(-50%) scale(0.94);
    opacity: 0;
  }
}

@keyframes toast-in {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
}

@keyframes ticker-in {
  from {
    opacity: 0.2;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes dot {
  0%,
  60%,
  100% {
    opacity: 0.2;
  }
  30% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Cartoon tabletop skin: wooden table, chunky outlined lettering, bouncy bits.
   ========================================================================== */

:root {
  --outline: 0 2px 0 #3a1404, 1.5px 0 0 #3a1404, -1.5px 0 0 #3a1404, 0 -1.5px 0 #3a1404;
  --spring: cubic-bezier(0.3, 1.8, 0.5, 1);
}

h3,
.topbar-title {
  text-shadow: 0 2px 0 rgba(40, 12, 0, 0.55);
}

.panel {
  box-shadow: inset 0 1px 0 rgba(255, 210, 160, 0.12), 0 6px 18px rgba(20, 5, 0, 0.25);
}

.btn {
  transition: transform 0.14s var(--spring), box-shadow 0.08s, filter 0.15s;
}

@media (hover: hover) {
  .btn:hover:not(:disabled) {
    transform: translateY(-2px) rotate(-1deg) scale(1.03);
  }
}

.btn:active:not(:disabled) {
  transform: translateY(3px) scale(0.97, 0.93);
}

.icon-btn {
  box-shadow: inset 0 0 0 2px rgba(255, 200, 150, 0.14);
  transition: transform 0.14s var(--spring), background 0.15s;
}

.icon-btn:active:not(:disabled) {
  transform: scale(0.86);
}

.avatar {
  box-shadow: 0 0 0 3px #5a2c12, inset 0 0 0 2px rgba(255, 224, 180, 0.3), 0 4px 0 rgba(30, 8, 0, 0.35);
}

/* ---- seats */

.seat,
.seat.current,
.seat.targeted {
  background: none;
  box-shadow: none;
}

.seat-name {
  order: -1;
  font-family: var(--display);
  font-weight: normal;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: var(--outline);
  margin: 0 0 4px;
  padding: 2px 2px 0;
}

.seat.current .seat-name {
  color: #ffd75e;
}

.seat .avatar {
  transition: box-shadow 0.25s;
}

.seat.current .avatar {
  box-shadow: 0 0 0 3px #ffd75e, 0 0 20px rgba(255, 200, 70, 0.85);
  animation: seat-bob 0.9s ease-in-out infinite;
}

.seat.targeted .avatar {
  box-shadow: 0 0 0 3px var(--red), 0 0 20px rgba(239, 51, 64, 0.85);
  animation: jitter 0.28s linear infinite;
}

.seat-cards {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 20px;
  margin-top: -5px;
  position: relative;
  z-index: 1;
  color: #fff;
  text-shadow: var(--outline);
}

.fan {
  display: inline-flex;
  padding-left: 4px;
}

.fan .mini-back {
  width: 12px;
  height: 17px;
  margin: 0 -3.5px;
  transform-origin: 50% 140%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.fan-n {
  font-family: var(--display);
  font-weight: normal;
  display: inline-block;
  animation: count-pop 0.35s var(--spring);
}

/* ---- centre of the table */

.status {
  font-family: var(--display);
  letter-spacing: 0.02em;
  font-size: 1.02rem;
  color: var(--ink);
  background: linear-gradient(#fbe6b8, #efcb8a);
  border: 3px solid #a8672f;
  border-radius: 10px;
  padding: 0.42em 0.9em 0.22em;
  min-height: 0;
  rotate: -1.5deg;
  box-shadow: 0 4px 0 rgba(40, 12, 0, 0.45), 0 10px 18px rgba(20, 5, 0, 0.3);
  animation: sign-in 0.45s var(--spring);
}

.status b {
  color: #8a300c;
  font-weight: normal;
}

.status.mine {
  background: linear-gradient(#ffe680, #ffc233);
  border-color: #fff;
}

.status.mine b {
  color: #b3122b;
  font-size: 1.3rem;
}

.status .timebar {
  background: rgba(60, 20, 0, 0.22);
}

.piles {
  gap: clamp(12px, 4.5vw, 40px);
  padding-bottom: 2.3em;
}

.pile .stack {
  transition: transform 0.14s var(--spring);
}

.pile.deck:active:not(:disabled) .stack {
  transform: scale(0.93, 0.9);
}

.pile .stack::before,
.pile .stack::after {
  background: #a80f24;
  border: 1px solid #ff6a4d;
}

.pile.deck.can-draw .stack > .card {
  box-shadow: 0 0 0 3px #ffd75e, 0 0 30px rgba(255, 200, 70, 0.85);
  animation: deck-wiggle 1.5s ease-in-out infinite;
}

.pile-hint {
  background: none;
  padding: 0;
  color: #fff;
  font-size: calc(var(--cw) * 0.27);
  text-shadow: var(--outline), 0 0 14px rgba(120, 0, 10, 0.8);
  animation: hint-bounce 0.8s ease-in-out infinite;
}

.pile-left {
  position: absolute;
  left: 50%;
  top: calc(100% + 11px);
  transform: translateX(-50%) rotate(-1.5deg);
  white-space: nowrap;
  font-family: var(--display);
  font-size: clamp(0.68rem, calc(var(--cw) * 0.13), 1rem);
  letter-spacing: 0.03em;
  color: #fff;
  background: rgba(48, 18, 6, 0.78);
  padding: 0.3em 0.7em 0.1em;
  border-radius: 6px;
}

.empty-slot {
  border: 0;
  flex-direction: column;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.15em;
  background: rgba(58, 24, 9, 0.8);
  border-radius: calc(var(--cw) * 0.14);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 210, 160, 0.15);
  font-family: var(--display);
  line-height: 0.95;
  color: #f8e6d0;
  text-align: center;
}

.empty-slot small {
  font-size: calc(var(--cw) * 0.14);
  opacity: 0.85;
}

.empty-slot b {
  font-size: calc(var(--cw) * 0.3);
  font-weight: normal;
}

.discard-top,
.discard-under {
  display: block;
  rotate: var(--rot, 0deg);
}

.discard-under {
  position: absolute;
  inset: 0;
}

.discard-top {
  position: relative;
  animation: thump 0.42s 0.4s var(--spring) backwards;
}

/* ---- keg odds gauge */

.odds {
  position: relative;
  flex: none;
  width: calc(var(--cw) * 1.05);
  display: grid;
  justify-items: center;
  filter: drop-shadow(0 5px 5px rgba(20, 5, 0, 0.4));
}

.odds svg {
  width: 100%;
  display: block;
  overflow: visible;
}

.odds-rim {
  fill: #fff;
  stroke: #e6d6cb;
  stroke-width: 1.5;
}

.odds-face {
  fill: #f5ece6;
}

.odds svg > path {
  fill: none;
  stroke-width: 14;
}

.odds-needle {
  transform-origin: 50px 50px;
  transition: transform 1s cubic-bezier(0.3, 2.2, 0.4, 0.85);
}

.odds-needle path {
  fill: #ef3340;
  stroke: #fff;
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.odds-hub {
  fill: #ef3340;
  stroke: #fff;
  stroke-width: 2;
}

.odds-label {
  position: relative;
  z-index: 1;
  margin-bottom: -0.55em;
  rotate: -4deg;
  white-space: nowrap;
  font-family: var(--display);
  font-size: clamp(0.5rem, calc(var(--cw) * 0.115), 0.85rem);
  letter-spacing: 0.04em;
  color: #ef3340;
  background: #fff;
  border-radius: 99px;
  padding: 0.35em 0.75em 0.12em;
  box-shadow: 0 2px 0 #dccabd;
}

.odds-read {
  position: relative;
  margin-top: -0.75em;
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--display);
  font-size: clamp(0.75rem, calc(var(--cw) * 0.19), 1.35rem);
  line-height: 1;
  color: #ef3340;
  background: #fff;
  border-radius: 8px;
  padding: 0.25em 0.5em 0.05em;
  box-shadow: 0 3px 0 #dccabd;
  transition: background 0.3s, color 0.3s;
}

.odds-read b {
  font-weight: normal;
  display: inline-block;
  animation: count-pop 0.45s var(--spring);
}

.odds-read small {
  font-size: 0.6em;
}

.odds-kegs {
  display: flex;
  align-items: center;
  font-size: 0.62em;
  color: #7a4a2c;
}

.odds-kegs img {
  width: 1.35em;
  height: 1.35em;
}

.odds.warm .odds-read {
  rotate: -2deg;
}

.odds.hot {
  animation: jitter 0.25s linear infinite;
}

.odds.hot .odds-read {
  background: #ef3340;
  color: #fff;
  box-shadow: 0 3px 0 #8f1420;
}

.odds.hot .odds-kegs {
  color: #ffe1c4;
}

/* ---- your hand */

.me-area {
  background: linear-gradient(rgba(30, 8, 0, 0), rgba(30, 8, 0, 0.42));
  border-top: 0;
}

.me-area.my-turn {
  background: linear-gradient(rgba(255, 200, 80, 0), rgba(255, 200, 80, 0.22));
}

.hand-card {
  rotate: calc(var(--f, 0) * 1.5deg);
  translate: 0 calc(var(--f, 0) * var(--f, 0) * 1.1px);
  transform-origin: 50% 100%;
  transition: transform 0.22s var(--spring), margin 0.2s;
  animation: deal-in 0.4s 0.3s var(--spring) backwards;
}

.hand-card.sel {
  transform: translateY(-20px) scale(1.06);
}

.hand-card.sel .card {
  box-shadow: 0 0 0 3px #ffd75e, 0 0 22px rgba(255, 200, 70, 0.75), 0 12px 22px rgba(0, 0, 0, 0.5);
}

/* ---- effects */

.fx-banner {
  -webkit-text-stroke: 0.1em #3a1404;
  paint-order: stroke fill;
  text-shadow: 0 0.1em 0 #3a1404, 0 0 34px rgba(0, 0, 0, 0.5);
}

.fx-banner.tone-danger {
  text-shadow: 0 0.1em 0 #3a1404, 0 0 30px rgba(255, 90, 30, 0.8);
}

.fx-banner.tone-nope {
  -webkit-text-stroke: 0;
}

.fx-bubble {
  border: 3px solid #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.fx-ring {
  position: fixed;
  z-index: 2;
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
  border-radius: 50%;
  border: 10px solid #fff3c4;
  box-shadow: 0 0 30px #ff8a2a, inset 0 0 20px #ff8a2a;
}

.fx-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  box-shadow: inset 0 0 22vmin 6vmin rgba(239, 51, 64, 0.75);
}

@keyframes seat-bob {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -4px;
  }
}

@keyframes jitter {
  0%,
  100% {
    translate: 0 0;
  }
  25% {
    translate: -1.5px 1px;
  }
  50% {
    translate: 1.5px -1px;
  }
  75% {
    translate: -1px -1.5px;
  }
}

@keyframes count-pop {
  from {
    scale: 1.9;
  }
}

@keyframes sign-in {
  from {
    scale: 0.5;
    rotate: 8deg;
    opacity: 0;
  }
}

@keyframes deck-wiggle {
  0%,
  60%,
  100% {
    transform: none;
  }
  70% {
    transform: translateY(-5px) rotate(-3deg);
  }
  80% {
    transform: translateY(-5px) rotate(3deg);
  }
  90% {
    transform: translateY(-2px) rotate(-1.5deg);
  }
}

@keyframes hint-bounce {
  0%,
  100% {
    scale: 1;
    rotate: -4deg;
  }
  50% {
    scale: 1.14;
    rotate: 3deg;
  }
}

@keyframes thump {
  0% {
    opacity: 0;
    transform: scale(1.25);
  }
  1% {
    opacity: 1;
    transform: scale(1.25);
  }
  45% {
    transform: scale(0.92, 0.9);
  }
}

@keyframes deal-in {
  from {
    opacity: 0;
    scale: 0.5;
  }
}

/* ---- slaps */

.fx-throw {
  position: fixed;
  z-index: 3;
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45));
}

.setting.off {
  opacity: 0.45;
}

/* ==========================================================================
   Extra-cartoony pass: thick ink outlines, sticker-style cards and buttons,
   breathing avatars that pull faces, and loud overlays.
   ========================================================================== */

:root {
  --ink-line: #2b1004;
}

/* ---- sticker cards: a dark ink line around the coloured frame */
.card {
  box-shadow: 0 0 0 max(1.5px, calc(var(--cw) * 0.022)) var(--ink-line), 0 calc(var(--cw) * 0.05) 0 max(1.5px, calc(var(--cw) * 0.022)) var(--ink-line), 0 8px 16px rgba(20, 5, 0, 0.35);
}

.card-title {
  text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.12);
}

.card.k-keg {
  box-shadow: 0 0 0 max(1.5px, calc(var(--cw) * 0.022)) var(--ink-line), 0 calc(var(--cw) * 0.05) 0 max(1.5px, calc(var(--cw) * 0.022)) var(--ink-line), 0 0 calc(var(--cw) * 0.22) rgba(255, 90, 54, 0.75);
}

.hand-card.sel .card {
  box-shadow: 0 0 0 max(1.5px, calc(var(--cw) * 0.022)) var(--ink-line), 0 0 0 calc(var(--cw) * 0.06) #ffd75e, 0 0 26px rgba(255, 200, 70, 0.8), 0 14px 22px rgba(0, 0, 0, 0.5);
}

@media (hover: hover) {
  .hand-card:hover:not(.sel):not(:disabled) .card {
    animation: card-wiggle 0.5s ease-in-out;
  }
}

/* ---- chunky outlined buttons */
.btn {
  border: 3px solid var(--ink-line);
  box-shadow: 0 5px 0 var(--ink-line), 0 10px 18px rgba(20, 5, 0, 0.35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn:active:not(:disabled) {
  box-shadow: 0 1px 0 var(--ink-line), 0 3px 8px rgba(20, 5, 0, 0.3);
}

.btn.secondary {
  box-shadow: 0 5px 0 var(--ink-line), 0 10px 18px rgba(20, 5, 0, 0.35);
}

.btn.nope {
  text-shadow: 0 2px 0 var(--ink-line);
  -webkit-text-stroke: 1px var(--ink-line);
  paint-order: stroke fill;
}

.btn.ghost {
  border: 2px solid rgba(43, 16, 4, 0.75);
  box-shadow: 0 3px 0 rgba(43, 16, 4, 0.75);
  text-shadow: none;
}

.icon-btn {
  border: 2px solid rgba(43, 16, 4, 0.7);
  box-shadow: 0 3px 0 rgba(43, 16, 4, 0.7);
}

.panel,
.sheet,
.gameover-card,
.pending {
  border: 3px solid var(--ink-line);
  box-shadow: 0 6px 0 var(--ink-line), 0 18px 34px rgba(20, 5, 0, 0.4);
}

.pending {
  border-color: #ffd75e;
  outline: 3px solid var(--ink-line);
}

.status {
  border-color: var(--ink-line);
  box-shadow: 0 4px 0 var(--ink-line), 0 10px 18px rgba(20, 5, 0, 0.3);
}

.odds-label,
.odds-read,
.pile-left {
  outline: 2px solid var(--ink-line);
}

.pile-left {
  outline-offset: 0;
}

/* ---- avatars: ink ring, idle breathing, room for reaction faces */
.avatar {
  box-shadow: 0 0 0 3px var(--ink-line), inset 0 0 0 2px rgba(255, 224, 180, 0.35), 0 4px 0 3px var(--ink-line);
  background: radial-gradient(circle at 35% 30%, #ffd9a8, #e3965a 70%);
}

.seat.current .avatar {
  box-shadow: 0 0 0 3px var(--ink-line), 0 0 0 7px #ffd75e, 0 0 24px rgba(255, 200, 70, 0.9);
}

.seat.targeted .avatar {
  box-shadow: 0 0 0 3px var(--ink-line), 0 0 0 7px var(--red), 0 0 24px rgba(239, 51, 64, 0.85);
}

.seat .avatar img {
  animation: breathe-face 2.6s ease-in-out infinite;
}

.seat:nth-child(2n) .avatar img {
  animation-delay: -1.1s;
  animation-duration: 3.1s;
}

.seat:nth-child(3n) .avatar img {
  animation-delay: -0.6s;
  animation-duration: 2.3s;
}

.seats:not(.crowded) .seat .avatar {
  --size: 54px !important;
}

@media (max-height: 560px) and (orientation: landscape) {
  .seats:not(.crowded) .seat .avatar {
    --size: 36px !important;
  }
}

.react-face {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 115%;
  height: 115%;
  margin: -57.5% 0 0 -57.5%;
  z-index: 7;
  pointer-events: none;
  filter: drop-shadow(0 3px 0 var(--ink-line)) drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4));
}

.hand {
  position: relative;
}

.react-face.mine {
  position: absolute;
  width: 84px;
  height: 84px;
  top: -30px;
  left: 50%;
  margin: 0 0 0 -42px;
}

/* ---- the keg showcase + captions + ribbon */
.card.showcase {
  z-index: 5;
}

.fx-caption {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 6;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(2rem, 9vw, 3.6rem);
  line-height: 1;
  color: #ffd75e;
  -webkit-text-stroke: 0.12em var(--ink-line);
  paint-order: stroke fill;
  text-shadow: 0 0.1em 0 var(--ink-line), 0 0 30px rgba(255, 90, 30, 0.8);
}

.fx-ribbon {
  position: fixed;
  left: 50%;
  top: 46%;
  z-index: 6;
  pointer-events: none;
}

.fx-ribbon span {
  display: block;
  white-space: nowrap;
  font-family: var(--display);
  font-size: clamp(2rem, 10vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0.02em;
  color: #fff;
  -webkit-text-stroke: 0.1em var(--ink-line);
  paint-order: stroke fill;
  text-shadow: 0 0.09em 0 var(--ink-line);
  background: linear-gradient(#ff5a4a, #d81e33);
  border: 4px solid var(--ink-line);
  border-radius: 12px;
  box-shadow: 0 7px 0 var(--ink-line), 0 18px 30px rgba(0, 0, 0, 0.4);
  padding: 0.3em 0.9em 0.12em;
}

.fx-banner {
  -webkit-text-stroke: 0.12em var(--ink-line);
}

.fx-bubble {
  border-color: var(--ink-line);
  box-shadow: 0 4px 0 var(--ink-line);
}

@keyframes breathe-face {
  0%,
  100% {
    scale: 1 1;
  }
  50% {
    scale: 1.05 0.95;
    translate: 0 4%;
  }
}

@keyframes card-wiggle {
  0%,
  100% {
    rotate: 0deg;
  }
  25% {
    rotate: -4deg;
  }
  60% {
    rotate: 3deg;
  }
}

/* ---- dirty tricks & the cursed keg */

.card.t-cursed {
  border-color: #3ddc84;
  box-shadow: 0 0 0 max(1.5px, calc(var(--cw) * 0.022)) var(--ink-line), 0 calc(var(--cw) * 0.05) 0 max(1.5px, calc(var(--cw) * 0.022)) var(--ink-line), 0 0 calc(var(--cw) * 0.25) rgba(61, 220, 132, 0.8);
}

.card.t-cursed .card-in {
  background: radial-gradient(circle at 50% 62%, #1f6b45, #071a10 78%);
}

.card.t-cursed .card-tag {
  color: #9dff7a;
}

/* inked: you see only ink blots where your cards should be */
.card.back.inked {
  background: #1e1a2e;
  border-color: #3a3352;
}

.card.back.inked .card-in {
  background: #2d2645 url('/art/ink.svg') center / 80% no-repeat;
}

.card.back.inked .back-emblem {
  display: none;
}

.hand-card.stuck .card {
  filter: saturate(0.45) brightness(0.85);
}

.barnacled {
  position: absolute;
  right: -6%;
  bottom: 18%;
  width: 62%;
  pointer-events: none;
  filter: drop-shadow(0 3px 0 var(--ink-line));
  rotate: -12deg;
  animation: clamp-on 0.5s var(--spring);
}

.badge.ink,
.badge.gull {
  width: 28px;
  height: 28px;
  min-width: 0;
  padding: 0;
  background: #fff;
  border: 2px solid var(--ink-line);
}

.badge.ink {
  bottom: -6px;
  left: -12px;
}

.badge.gull {
  top: -10px;
  right: -14px;
  animation: seat-bob 0.7s ease-in-out infinite;
}

.badge.ink img,
.badge.gull img {
  width: 22px;
  height: 22px;
}

.cursed-at {
  position: absolute;
  left: 50%;
  top: -14px;
  transform: translateX(-50%) rotate(3deg);
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  font-family: var(--display);
  font-size: clamp(0.65rem, calc(var(--cw) * 0.13), 0.95rem);
  color: #c8ffb0;
  background: #0d2a1a;
  border: 2px solid #3ddc84;
  outline: 2px solid var(--ink-line);
  border-radius: 99px;
  padding: 0.15em 0.6em 0 0.2em;
  z-index: 3;
}

.cursed-at img {
  width: 1.7em;
  height: 1.7em;
  margin-top: -0.2em;
}

.cursed-at.top {
  color: #fff;
  background: #1f9a5a;
  animation: jitter 0.25s linear infinite;
}

.fx-ink {
  position: fixed;
  z-index: 5;
  pointer-events: none;
}

.fx-banner.tone-cursed {
  color: #c8ffb0;
  text-shadow: 0 0.1em 0 var(--ink-line), 0 0 30px rgba(61, 220, 132, 0.9);
}

.fx-bubble.tone-cursed {
  background: #1f9a5a;
}

/* cartoon stretch: a selected card stretches up like taffy, then snaps back */
.hand-card.sel .card {
  transform-origin: 50% 100%;
  animation: stretch-pop 0.5s var(--spring);
}

.pile.deck:active:not(:disabled) .stack > .card {
  scale: 1.12 0.82;
}

@keyframes stretch-pop {
  0% {
    scale: 1 1;
  }
  30% {
    scale: 0.84 1.22;
  }
  55% {
    scale: 1.1 0.9;
  }
  75% {
    scale: 0.97 1.04;
  }
  100% {
    scale: 1 1;
  }
}

@keyframes clamp-on {
  from {
    scale: 2.2;
    opacity: 0;
  }
}

/* ---- rules printed on the cards: bigger cards, compact text inside */

.card-desc {
  display: none;
  flex: none;
  margin: 0 0.32em 0.34em;
  padding: 0.38em 0.42em 0.34em;
  border-radius: calc(var(--cw) * 0.05);
  background: color-mix(in srgb, var(--c) 14%, #fff);
  border: max(1px, calc(var(--cw) * 0.012)) solid color-mix(in srgb, var(--c) 45%, #fff);
  font-family: var(--body);
  font-size: 0.64em;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: #2d1d14;
  text-align: center;
  overflow-wrap: anywhere;
  hyphens: auto;
}

/* only where a card is big enough to read */
.hand .card-desc,
.pile .card-desc,
.grid-card .card-desc,
.dc-card .card-desc,
.peek-slot .card-desc,
.bury-card .card-desc,
.card.flying .card-desc {
  display: block;
}

.card.k-keg .card-desc {
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 170, 120, 0.5);
  color: #ffe9d6;
}

.card.t-cursed .card-desc {
  border-color: rgba(120, 255, 170, 0.5);
  color: #dcffe6;
}

.card.k-crew .card-art {
  margin-bottom: 0.25em;
}

/* the text takes room from the picture, not from the title */
.hand .card-art img,
.pile .card-art img,
.card.flying .card-art img {
  width: 64%;
}

/* bigger hand cards */
.hand {
  --cw: clamp(84px, min(31vw, 18.5dvh), 152px);
  padding-top: 24px;
  padding-bottom: calc(8px + var(--safe-b));
}

@media (min-width: 1000px) {
  .hand {
    --cw: clamp(90px, 18.5dvh, 156px);
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .hand {
    --cw: clamp(64px, 25dvh, 112px);
  }
}

/* overlapped cards: keep title and text readable on the visible left part */
.hand.tight .card-desc {
  text-align: left;
  margin-right: 37%;
}

.hand.tight .card-title {
  overflow-wrap: normal;
  white-space: nowrap;
}

.action-bar {
  min-height: 50px;
}

.sel-info > span:not(.sel-title) {
  -webkit-line-clamp: 1;
}

/* the card picked up for a closer look in the menus */
.card-grid {
  --cw: clamp(96px, 28vw, 136px);
}
