/* Layout, cards and components. Colors and fonts come from the active theme file. */

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

:root {
  --bar-h: 68px;
  --stripes-h: 14px;
  --status-h: 60px;
  --ease: cubic-bezier(0.2, 0.8, 0.25, 1);
  --cw: 100px;
  --ch: 140px;

  --suit-c: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.6a4.6 4.6 0 0 0-4.3 6.2 4.6 4.6 0 1 0 2.9 8.3c-.3 2.4-1.3 4.4-2.9 5.9h8.6c-1.6-1.5-2.6-3.5-2.9-5.9a4.6 4.6 0 1 0 2.9-8.3A4.6 4.6 0 0 0 12 1.6z'/%3E%3C/svg%3E");
  --suit-d: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1c2.6 4 5.3 7.6 8.6 11-3.3 3.4-6 7-8.6 11-2.6-4-5.3-7.6-8.6-11C6.7 8.6 9.4 5 12 1z'/%3E%3C/svg%3E");
  --suit-h: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22l-1.5-1.4C5.2 15.8 1.8 12.7 1.8 8.8 1.8 5.6 4.3 3.1 7.4 3.1c1.8 0 3.5.8 4.6 2.2 1.1-1.4 2.8-2.2 4.6-2.2 3.1 0 5.6 2.5 5.6 5.7 0 3.9-3.4 7-8.7 11.8z'/%3E%3C/svg%3E");
  --suit-s: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.4C9 6 2.8 9.2 2.8 13.8c0 2.8 2.2 4.8 4.8 4.8 1.5 0 2.8-.6 3.7-1.6-.3 2-1.3 3.7-2.8 5h7c-1.5-1.3-2.5-3-2.8-5 .9 1 2.2 1.6 3.7 1.6 2.6 0 4.8-2 4.8-4.8C21.2 9.2 15 6 12 1.4z'/%3E%3C/svg%3E");
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--page-bg);
  background-image: var(--page-art);
  background-attachment: fixed;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent-3);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- header ------------------------------------------------------------- */

.bar {
  position: relative;
  z-index: 20;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: var(--bar-bg);
  color: var(--bar-ink);
}

.stripes {
  height: var(--stripes-h);
  background: var(--stripes);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: none;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-2);
  color: var(--accent-3);
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 0 0 0 4px var(--accent), 0 0 0 8px var(--accent-3);
  margin: 0 6px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  white-space: nowrap;
}

.games {
  display: flex;
  gap: 6px;
  margin-left: 10px;
}

.games a {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 2px solid var(--tab-border);
  color: var(--tab-ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
}

.games a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.games a[aria-current='page'] {
  background: var(--tab-on-bg);
  border-color: var(--tab-on-bg);
  color: var(--tab-on-ink);
}

.tools {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.tool {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--tool-bg);
  color: var(--tool-ink);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s var(--ease), filter 0.15s;
}

.tool:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.tool:active {
  transform: translateY(1px) scale(0.97);
}

.tool:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.tool.icon {
  width: 44px;
  padding: 0;
  justify-content: center;
}

.tool.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.tool svg {
  width: 20px;
  height: 20px;
  flex: none;
}

#sound[aria-pressed='false'] .on,
#sound[aria-pressed='true'] .off {
  display: none;
}

/* ---- play area ---------------------------------------------------------- */

.play {
  position: relative;
  height: calc(100vh - var(--bar-h) - var(--stripes-h) - var(--status-h));
  height: calc(100dvh - var(--bar-h) - var(--stripes-h) - var(--status-h));
  min-height: 380px;
}

.table {
  position: absolute;
  inset: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.status {
  height: var(--status-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  background: var(--bar-bg);
  color: var(--bar-ink);
  font-weight: 700;
  font-size: 15px;
  overflow: hidden;
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--bar-raised);
  white-space: nowrap;
}

.stat b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.variant {
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-2);
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.finish {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 8000;
  transform: translateX(-50%);
  height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--pop-bg);
  color: var(--pop-ink);
  font-family: var(--font-display);
  font-size: 20px;
  box-shadow: 0 0 0 4px var(--pop-ring), 0 8px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  animation: bob 1.6s ease-in-out infinite;
}

.finish[hidden] {
  display: none;
}

.toast {
  position: absolute;
  left: 50%;
  top: 14px;
  z-index: 9000;
  max-width: calc(100% - 32px);
  padding: 10px 20px;
  border-radius: 16px;
  background: var(--panel);
  color: var(--panel-ink);
  font-weight: 800;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 0 0 3px var(--accent), 0 10px 24px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.3s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

.card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cw);
  height: var(--ch);
  transition: transform 0.32s var(--ease) var(--d, 0ms);
  touch-action: none;
  cursor: pointer;
  will-change: transform;
}

.card .inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: perspective(calc(var(--cw) * 9)) rotateY(180deg);
  transition: transform 0.36s ease var(--d, 0ms);
}

.card.up .inner {
  transform: perspective(calc(var(--cw) * 9)) rotateY(0deg);
}

.front,
.back {
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: max(1.5px, calc(var(--cw) * 0.02)) solid var(--card-edge);
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s;
}

.front {
  background: var(--card-face);
  overflow: hidden;
}

.back {
  transform: rotateY(180deg);
  background: var(--card-back);
  box-shadow: inset 0 0 0 calc(var(--cw) * 0.05) var(--card-face), var(--card-shadow);
}

.no-anim .card,
.no-anim .card .inner {
  transition: none !important;
}

.card.dragging {
  transition: none;
  cursor: grabbing;
}

.card.dragging .front,
.card.flying .front,
.card.flying .back {
  box-shadow: var(--card-lift);
}

.su-h,
.su-d {
  color: var(--card-red);
}

.su-s,
.su-c {
  color: var(--card-black);
}

.su-c {
  --suit: var(--suit-c);
}
.su-d {
  --suit: var(--suit-d);
}
.su-h {
  --suit: var(--suit-h);
}
.su-s {
  --suit: var(--suit-s);
}

.pip {
  display: inline-block;
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: var(--suit) center / contain no-repeat;
  mask: var(--suit) center / contain no-repeat;
}

.idx {
  position: absolute;
  display: flex;
  align-items: center;
  gap: calc(var(--cw) * 0.02);
  line-height: 1;
}

.idx b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(var(--cw) * 0.24);
  letter-spacing: -0.03em;
}

.idx .pip {
  font-size: calc(var(--cw) * 0.17);
}

.tl {
  top: calc(var(--cw) * 0.07);
  left: calc(var(--cw) * 0.08);
}

.br {
  bottom: calc(var(--cw) * 0.07);
  right: calc(var(--cw) * 0.08);
  transform: rotate(180deg);
}

.mid {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--cw) * 0.5);
}

.mid.ace {
  font-size: calc(var(--cw) * 0.62);
}

.mid.face {
  inset: 30% 14% 24%;
  border-radius: 999px;
  background: var(--face-bg);
  box-shadow: 0 0 0 calc(var(--cw) * 0.03) var(--face-ring);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--cw) * 0.02);
}

.mid.face b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: calc(var(--cw) * 0.36);
  line-height: 1;
}

.mid.face .pip {
  font-size: calc(var(--cw) * 0.2);
}

/* Small cards (phones): drop the bottom index and shrink the center art so ranks stay readable. */
.table.small .br {
  display: none;
}
.table.small .idx b {
  font-size: calc(var(--cw) * 0.3);
}
.table.small .idx .pip {
  font-size: calc(var(--cw) * 0.22);
}
.table.small .mid {
  inset: 32% 0 0;
  font-size: calc(var(--cw) * 0.44);
}
.table.small .mid.face {
  inset: 40% 10% 12%;
}
.table.small .mid.face .pip {
  display: none;
}

/* ---- slots and feedback -------------------------------------------------- */

.slot {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cw);
  height: var(--ch);
  border-radius: var(--card-radius);
  border: max(2px, calc(var(--cw) * 0.03)) dashed var(--slot-border);
  background: var(--slot-fill);
  color: var(--slot-ink);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: calc(var(--cw) * 0.36);
}

.slot svg {
  width: 44%;
  height: 44%;
}

.stock-slot {
  cursor: pointer;
}

.cell-slot {
  border-style: solid;
}

.cell-slot span {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: calc(var(--cw) * 0.15);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card.hint {
  animation: hop 0.9s ease-in-out infinite;
}

.card.hint .front,
.card.hint .back,
.card.target .front {
  box-shadow: 0 0 0 calc(var(--cw) * 0.05) var(--hint-ring), 0 0 0 calc(var(--cw) * 0.09) var(--glow);
}

.slot.target {
  border-style: solid;
  border-color: var(--glow);
  background: var(--hint-ring);
}

.card.selected {
  translate: 0 calc(var(--ch) * -0.05);
}

.card.selected .front {
  box-shadow: 0 0 0 calc(var(--cw) * 0.05) var(--card-face), 0 0 0 calc(var(--cw) * 0.1) var(--select-ring), var(--card-lift);
}

.shake {
  animation: shake 0.42s ease-in-out;
}

.pop {
  position: absolute;
  z-index: 9000;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--pop-bg);
  color: var(--pop-ink);
  font-family: var(--font-display);
  font-size: clamp(14px, calc(var(--cw) * 0.2), 20px);
  white-space: nowrap;
  box-shadow: 0 0 0 3px var(--pop-ring);
  pointer-events: none;
  animation: pop 1.25s var(--ease) forwards;
}

@keyframes hop {
  50% {
    translate: 0 calc(var(--ch) * -0.07);
  }
}

@keyframes shake {
  20% {
    translate: -6px 0;
  }
  40% {
    translate: 6px 0;
  }
  60% {
    translate: -4px 0;
  }
  80% {
    translate: 3px 0;
  }
}

@keyframes pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.5) rotate(-8deg);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -12px) scale(1.12) rotate(3deg);
  }
  40% {
    transform: translate(-50%, -16px) scale(1) rotate(-3deg);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -44px) scale(0.95) rotate(-3deg);
  }
}

@keyframes bob {
  50% {
    translate: 0 -6px;
  }
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

/* ---- dialogs ------------------------------------------------------------ */

.modal {
  width: min(92vw, 460px);
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: var(--panel);
  color: var(--panel-ink);
  box-shadow: 0 0 0 6px var(--accent), 0 0 0 12px var(--accent-3), 0 30px 60px rgba(0, 0, 0, 0.35);
}

.modal::backdrop {
  background: var(--backdrop);
}

.modal[open] {
  animation: modal-in 0.45s var(--ease);
}

.modal-body {
  padding: 28px 28px 24px;
}

.modal h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.05;
  text-align: center;
  color: var(--accent-3);
}

.modal .lede {
  margin: 0 0 20px;
  text-align: center;
  font-weight: 700;
}

.modal h3 {
  margin: 18px 0 8px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.stats div {
  padding: 12px 6px;
  border-radius: 16px;
  background: var(--bar-bg);
  color: var(--bar-ink);
  text-align: center;
}

.stats dt {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
}

.stats dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--bar-bg);
  color: var(--bar-ink);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn.ghost {
  background: transparent;
  color: var(--panel-ink);
  box-shadow: inset 0 0 0 2px var(--panel-ink);
}

.choices {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choices legend {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(74, 44, 26, 0.08);
  font-weight: 700;
  cursor: pointer;
}

.choice input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-3);
}

.choice:has(input:checked) {
  background: var(--accent-2);
}

.close-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--panel-ink);
  cursor: pointer;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(0.85) rotate(-2deg);
  }
}

/* ---- how-to-play card ----------------------------------------------------- */

.howto {
  width: min(94vw, 740px);
  max-height: calc(100dvh - 40px);
}

.howto .modal-body {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 40px);
  box-sizing: border-box;
  padding-bottom: 16px;
}

.howto h1 {
  margin: 0 40px 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.1;
  text-align: center;
  color: var(--accent-3);
}

.htabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: var(--ink);
}

.htabs button {
  flex: 1;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--bar-ink);
  font: 800 15px var(--font-body);
  cursor: pointer;
}

.htabs button[aria-selected='true'] {
  background: var(--accent-2);
  color: var(--ink);
}

.hpanel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.5;
}

.hpanel p,
.hpanel ul {
  margin: 0 0 10px;
}

.hpanel ul {
  padding-left: 20px;
}

.hpanel li {
  margin: 0 0 6px;
}

.hpanel h2 {
  margin: 14px 0 4px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.15;
}

.howto .actions {
  margin-top: 8px;
}

.hfoot {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.75;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .howto .modal-body {
    padding: 18px 16px 12px;
  }
  .howto h1 {
    margin: 0 44px 10px;
    font-size: 25px;
  }
  .htabs button {
    height: 36px;
    font-size: 14px;
  }
  .hpanel {
    margin-top: 10px;
    font-size: 14.5px;
    line-height: 1.4;
  }
  .hpanel ul {
    padding-left: 18px;
  }
  .hpanel li {
    margin-bottom: 4px;
  }
  .howto .actions .btn {
    height: 44px;
  }
  .howto .actions {
    margin-top: 4px;
  }
  .hfoot {
    margin-top: 8px;
  }
}

.site-foot {
  padding: 0 20px 40px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 1320px) {
  .tool .label {
    display: none;
  }
  .tool:not(.icon) {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
}

/* The game tabs move to a second header row when the header can't fit them in one. */
@media (max-width: 1240px) {
  :root {
    --bar-h: 104px;
  }
  .bar {
    flex-wrap: wrap;
    align-content: center;
    gap: 8px 10px;
    padding: 0 12px;
  }
  .games {
    order: 3;
    width: 100%;
    margin: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .games a {
    height: 34px;
    padding: 0 14px;
    font-size: 14px;
  }
  .brand-name {
    font-size: 22px;
  }
  .logo {
    width: 32px;
    height: 32px;
    font-size: 16px;
    box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px var(--accent-3);
  }
  .tools {
    gap: 6px;
  }
}

/* Phones and small tablets: the tabs stack in two even rows instead of running off the side. */
@media (max-width: 720px) {
  :root {
    --bar-h: 140px;
  }
  .games {
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), auto);
    gap: 6px;
    overflow: visible;
  }
  .games a {
    justify-content: center;
    min-width: 0;
    height: 32px;
    padding: 0 6px;
    font-size: 13.5px;
  }
  .games .sep {
    display: none;
  }
}

@media (max-width: 370px) {
  .games a {
    padding: 0 4px;
    font-size: 12.5px;
  }
}

@media (max-width: 640px) {
  :root {
    --status-h: 52px;
  }
  .status {
    gap: 6px;
    padding: 0 10px;
    font-size: 13px;
  }
  .stat {
    height: 34px;
    padding: 0 10px;
    gap: 5px;
  }
  .stat b {
    font-size: 16px;
  }
  .variant {
    display: none;
  }
  .brand-name {
    font-size: 19px;
  }
  .tool,
  .tool.icon,
  .tool:not(.icon) {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .bar .brand-name {
    display: none;
  }
  .lobby .bar .brand-name {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .card .inner {
    transition-duration: 0.01s !important;
  }
  .card.hint,
  .finish {
    animation: none;
  }
}

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

.lobby-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 20px 20px;
}

.hero {
  text-align: center;
  margin-bottom: 30px;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 92px);
  line-height: 1;
  color: var(--panel);
  text-shadow: 4px 4px 0 var(--accent-3), 8px 8px 0 var(--ink);
}

.hero p {
  margin: 18px auto 0;
  max-width: 560px;
  font-size: 19px;
  font-weight: 800;
}

.games-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.game-card {
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 0 0 4px var(--ink), 0 8px 0 4px var(--ink);
  overflow: hidden;
  transition: transform 0.2s var(--ease);
}

.game-card:hover {
  transform: translateY(-4px) rotate(-0.6deg);
}

.game-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 18px 18px;
  text-align: center;
  text-decoration: none;
}

.game-art {
  --cw: 62px;
  --tw: 52px;
  --th: 64px;
  --ch: 87px;
  position: relative;
  width: calc(62px + 3 * 34px);
  height: 104px;
  margin: 4px 0 12px;
}

.game-art .card,
.game-art .tile {
  transition: transform 0.35s var(--ease);
}

.game-card:hover .game-art > :nth-child(1) { translate: -8px 0; }
.game-card:hover .game-art > :nth-child(4) { translate: 8px 0; }

.game-card h3 {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
  color: var(--accent-3);
}

.game-card p {
  margin: 0 0 14px;
  font-weight: 700;
  line-height: 1.4;
}

.chip {
  margin-bottom: 16px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-2);
  font-weight: 800;
  font-size: 13px;
}

.play-btn {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 900;
}

.daily-link {
  display: block;
  padding: 12px;
  background: var(--bar-bg);
  color: var(--bar-ink);
  text-align: center;
  font-weight: 800;
  text-decoration: none;
}

.daily-link:hover {
  background: var(--bar-raised);
}

.lobby .site-foot {
  padding-top: 30px;
}

.shelf-section {
  margin-top: 34px;
}

.shelf-section h2 {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  color: var(--ink);
}

.games .sep {
  width: 2px;
  height: 26px;
  margin: 0 4px;
  background: var(--bar-raised);
  flex: none;
}

.games a.alt {
  border-style: dashed;
}

.hud {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tool .n:empty {
  display: none;
}

@media (max-width: 480px) {
  /* Keep long dialog titles clear of the close button. */
  .modal h2 {
    padding: 0 34px;
    font-size: 32px;
  }
}
