:root {
  color: #171714;
  background: #e7dfc8;
  font-family: "Courier New", Courier, monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #e7dfc8; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }

.play-mode-nav { position: fixed; z-index: 1000; top: 14px; right: 14px; display: flex; border: 3px solid #171714; background: #f7f0db; box-shadow: 4px 4px 0 #171714; }
.play-mode-nav a { padding: 8px 12px; color: #171714; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-decoration: none; text-transform: uppercase; }
.play-mode-nav a + a { border-left: 3px solid #171714; }
.play-mode-nav a.active { background: #f7d91e; }

.online-landing {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
}

.online-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(3rem, 8vw, 9rem);
  background: #171714;
  color: #f7f0db;
}

.online-kicker { letter-spacing: .18em; font-size: .72rem; font-weight: 800; }
.online-intro h1 { margin: 1rem 0; font-family: Impact, sans-serif; font-size: clamp(4rem, 10vw, 9rem); line-height: .78; letter-spacing: -.03em; }
.online-intro h1 span, .online-logo span { color: #e42b25; }
.online-intro > p:not(.online-kicker) { max-width: 35rem; font-size: 1.1rem; line-height: 1.55; }
.online-intro a { color: #f7d91e; font-weight: 800; margin-top: 2rem; }

.online-entry {
  align-self: center;
  display: grid;
  gap: 1rem;
  padding: clamp(2rem, 7vw, 7rem);
}

.online-entry label { display: grid; gap: .45rem; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.online-entry input { width: 100%; border: 3px solid #171714; background: #f7f0db; padding: 1rem; font-size: 1rem; box-shadow: 5px 5px 0 #171714; }
.online-entry button, .game-actions button, .start-game { border: 3px solid #171714; background: #f7f0db; color: #171714; padding: 1rem 1.25rem; font-weight: 900; text-transform: uppercase; box-shadow: 5px 5px 0 #171714; }
.online-entry button.primary, .game-actions button.primary, .start-game.primary { background: #f7d91e; }
.or { margin: .75rem 0; border-top: 2px solid #171714; text-align: center; }
.or span { position: relative; top: -.65rem; background: #e7dfc8; padding: 0 1rem; font-size: .72rem; text-transform: uppercase; }

.online-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 1rem 0 4rem; }
.online-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; border-bottom: 3px solid #171714; }
.online-header > div { text-align: right; }
.online-header small, .online-header b { display: block; }
.online-header small { letter-spacing: .14em; text-transform: uppercase; }
.online-logo { color: #171714; font-family: Impact, sans-serif; font-size: 2rem; text-decoration: none; letter-spacing: -.03em; }

.lobby-card { width: min(650px, 100%); margin: clamp(3rem, 9vh, 7rem) auto; border: 3px solid #171714; background: #f7f0db; padding: clamp(1.5rem, 4vw, 3rem); box-shadow: 12px 12px 0 #171714; }
.room-code { border: 0; background: transparent; padding: 0; font-family: Impact, sans-serif; font-size: clamp(4rem, 14vw, 8rem); letter-spacing: .08em; line-height: 1; color: #e42b25; }
.seat-list { display: grid; gap: .6rem; margin: 2rem 0; }
.seat { display: flex; gap: .75rem; align-items: center; min-height: 48px; border-bottom: 1px dashed #706c60; }
.seat em { font-size: .68rem; text-transform: uppercase; background: #f7d91e; padding: .2rem .4rem; }
.seat.empty { color: #8c8779; }
.connection { margin-left: auto; font-size: .68rem; text-transform: uppercase; }
.connection.online { color: #1b7651; }
.connection.offline { color: #a42a25; }
.start-game { width: 100%; }
.waiting-copy { text-align: center; }

.player-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin: 1rem 0; }
.player-chip { position: relative; border: 2px solid #171714; padding: .65rem .8rem; background: #f7f0db; }
.player-chip span, .player-chip b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-chip b { font-size: .7rem; margin-top: .25rem; }
.player-chip.current { background: #f7d91e; transform: translateY(3px); }
.player-chip.you { border-width: 3px; }
.presence { position: absolute; width: 8px; height: 8px; border-radius: 50%; right: .6rem; top: .6rem; background: #a42a25; }
.presence.online { background: #1b7651; }

.online-table { min-height: 290px; display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 4vw, 3rem); border: 3px solid #171714; background: #315d46; box-shadow: inset 0 0 0 8px #274c3a; color: #f7f0db; }
.pile { width: 110px; aspect-ratio: .68; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 3px solid #171714; background: #f7f0db; color: #171714; box-shadow: 6px 6px 0 #171714; }
.pile.deck { background: repeating-linear-gradient(45deg, #171714 0 7px, #f7d91e 7px 10px); color: #f7f0db; text-shadow: 2px 2px #171714; }
.pile > span { font-size: 2.4rem; font-weight: 900; }
.pile > strong { font-size: 3rem; }
.pile.red { color: #d32721; }
.table-status { width: 145px; }
.table-status small, .table-status b { display: block; }
.table-status b { margin-top: .5rem; text-transform: uppercase; }

.your-zone { border: 3px solid #171714; border-top: 0; background: #f7f0db; padding: 1.25rem; }
.hand-heading { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.hand-heading span { font-weight: 900; text-transform: uppercase; }
.online-hand { display: flex; align-items: end; overflow-x: auto; min-height: 160px; padding: 12px 6px 18px; }
.playing-card { flex: 0 0 92px; height: 138px; margin-left: -18px; border: 3px solid #171714; background: #fffdf6; box-shadow: 4px 4px 0 #171714; text-align: left; padding: .45rem; color: #171714; transition: transform .12s ease; }
.playing-card:first-child { margin-left: 0; }
.playing-card span, .playing-card strong { display: block; font-size: 1.45rem; }
.playing-card strong { font-size: 2.4rem; text-align: center; margin-top: 1rem; }
.playing-card.red { color: #d32721; }
.playing-card.selected { transform: translateY(-12px) rotate(-1deg); background: #fff6a7; }

.call-row, .game-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.call-row label { border: 2px solid #171714; padding: .6rem; }
.call-row select { border: 0; background: transparent; }
.turn-message { padding: 1rem; background: #e7dfc8; text-align: center; }
.game-log { list-style-position: inside; border: 3px solid #171714; border-top: 0; margin: 0; padding: 1rem 1.5rem; background: #e7dfc8; }
.game-log li { padding: .35rem 0; border-bottom: 1px dotted #706c60; }
.game-log .bad { color: #a42a25; }
.game-log .good, .game-log .shout { font-weight: 900; }
.game-over { text-align: center; }
.online-notice { border: 3px solid #171714; background: #e42b25; color: white; padding: .8rem 1rem; font-weight: 800; }
.online-notice.floating { position: fixed; right: 1rem; bottom: 1rem; max-width: min(440px, calc(100% - 2rem)); box-shadow: 5px 5px 0 #171714; }
.is-connecting button { pointer-events: none; }

@media (max-width: 720px) {
  .online-landing { grid-template-columns: 1fr; }
  .online-intro { min-height: 42vh; padding: 2rem; }
  .online-intro h1 { font-size: clamp(4rem, 22vw, 7rem); }
  .online-entry { padding: 2rem; }
  .online-table { min-height: 230px; gap: 1rem; }
  .pile { width: 78px; }
  .table-status { width: 100px; font-size: .75rem; }
  .playing-card { flex-basis: 76px; height: 116px; }
  .hand-heading small { display: none; }
}
