:root {
  --ink: #11110f;
  --paper: #f2eee3;
  --cream: #fffbed;
  --orange: #ff5b22;
  --yellow: #ffd320;
  --pink: #f05086;
  --blue: #2c76dc;
  --green: #31a869;
  --muted: #736f65;
  --shadow: 0 18px 50px rgba(20, 18, 10, .18);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: "DM Sans", sans-serif; background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.noise { position: fixed; inset: 0; pointer-events: none; z-index: 20; opacity: .035; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }

.landing { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(340px, .7fr); align-items: center; gap: clamp(40px, 7vw, 110px); padding: clamp(36px, 6vw, 96px); background: radial-gradient(circle at 8% 10%, #fff8dc 0, transparent 32%), linear-gradient(115deg, var(--paper) 0 58%, var(--yellow) 58%); }
.brand-block { max-width: 700px; }
.eyebrow { margin: 0 0 14px; font-family: "Barlow Condensed", sans-serif; font-weight: 800; letter-spacing: .14em; font-size: 14px; }
h1 { display: flex; align-items: center; gap: 18px; margin: 0; font-family: "Barlow Condensed", sans-serif; font-size: clamp(100px, 18vw, 240px); font-weight: 900; letter-spacing: -.08em; line-height: .72; }
h1 span { display: inline-block; transform: skew(-7deg); }
h1 strong { display: grid; place-items: center; width: .72em; height: .95em; padding-right: .04em; color: var(--cream); background: var(--orange); border-radius: 12% 28% 14% 25%; transform: rotate(5deg); box-shadow: 10px 12px 0 var(--ink); }
.tagline { max-width: 530px; margin: 44px 0 0; font-size: clamp(18px, 2vw, 27px); line-height: 1.35; font-weight: 500; }
.entry-card { padding: clamp(26px, 4vw, 48px); background: var(--cream); border: 3px solid var(--ink); box-shadow: 14px 14px 0 var(--ink); }
.entry-card label { display: block; margin-bottom: 8px; font-family: "Barlow Condensed", sans-serif; font-weight: 800; letter-spacing: .08em; }
input { width: 100%; height: 58px; padding: 0 17px; border: 2px solid var(--ink); border-radius: 0; background: transparent; outline: none; font-weight: 700; }
input:focus { box-shadow: inset 0 -5px 0 var(--yellow); }
.primary, .secondary { border: 2px solid var(--ink); font-family: "Barlow Condensed", sans-serif; font-weight: 900; letter-spacing: .04em; }
.primary { width: 100%; min-height: 62px; margin-top: 14px; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; color: white; background: var(--ink); font-size: 23px; }
.primary:hover { background: var(--orange); }
.primary span { font-size: 30px; }
.divider { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; color: var(--muted); font-family: "Barlow Condensed", sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .12em; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: #c9c3b6; }
.join-row { display: flex; gap: 10px; }
.join-row input { font-family: "Barlow Condensed", sans-serif; font-size: 25px; letter-spacing: .2em; text-transform: uppercase; }
.secondary { min-width: 100px; background: var(--yellow); font-size: 20px; }
.secondary:hover { background: var(--orange); color: white; }
.error { min-height: 20px; margin: 12px 0 0; color: #c52c2c; font-size: 13px; font-weight: 700; }

.table { min-height: 100vh; padding-bottom: 150px; background: radial-gradient(circle at 50% -10%, #fffce9 0, var(--paper) 40%); }
header { height: 82px; padding: 0 clamp(18px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--ink); background: rgba(242, 238, 227, .9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.mini-logo { color: var(--ink); text-decoration: none; font-family: "Barlow Condensed", sans-serif; font-size: 27px; font-weight: 900; letter-spacing: -.05em; }
.mini-logo b { display: inline-grid; place-items: center; width: 29px; height: 34px; margin-left: 5px; color: white; background: var(--orange); transform: rotate(5deg); }
.room-pill { font-family: "Barlow Condensed", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .12em; }
.room-pill button { margin-left: 7px; padding: 7px 10px; border: 1.5px solid var(--ink); background: white; font-size: 17px; font-weight: 900; letter-spacing: .12em; }
.room-pill small { color: var(--muted); }
.connection { font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 13px; letter-spacing: .1em; }
.connection i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(49,168,105,.15); }
.connection.offline i { background: #d23b3b; }
.round-bar { min-height: 110px; padding: 22px clamp(18px, 4vw, 58px); display: grid; grid-template-columns: 90px 1fr 90px; align-items: center; gap: 20px; border-bottom: 1px solid #bdb7a9; }
.round-bar > div { display: grid; text-align: center; }
.round-bar span { font-family: "Barlow Condensed", sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .13em; color: var(--muted); }
.round-bar b { font-family: "Barlow Condensed", sans-serif; font-size: 34px; }
.round-bar p { margin: 0; text-align: center; font-weight: 700; }
.players { max-width: 1500px; margin: 0 auto; padding: clamp(24px, 4vw, 55px); display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 24px; }
.player { position: relative; min-height: 280px; padding: 20px; background: rgba(255,251,237,.7); border: 2px solid #bdb7a9; transition: .2s ease; }
.player.active { border-color: var(--ink); box-shadow: 8px 8px 0 var(--yellow); transform: translate(-3px,-3px); }
.player.me { background: var(--cream); }
.player.inactive { opacity: .72; }
.player-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 15px; border-bottom: 1px solid #cfc9ba; }
.player-name { display: flex; align-items: center; gap: 7px; font-family: "Barlow Condensed", sans-serif; font-weight: 900; font-size: 24px; text-transform: uppercase; }
.host-tag, .you-tag { padding: 3px 6px; color: var(--ink); background: var(--yellow); font-family: "DM Sans", sans-serif; font-size: 9px; letter-spacing: .07em; }
.you-tag { background: var(--pink); color: white; }
.offline-dot { width: 8px; height: 8px; border-radius: 50%; background: #d23b3b; }
.scores { display: flex; gap: 16px; text-align: right; }
.score { display: grid; }
.score span { color: var(--muted); font-family: "Barlow Condensed", sans-serif; font-size: 10px; letter-spacing: .1em; }
.score b { font-family: "Barlow Condensed", sans-serif; font-size: 27px; line-height: 1; }
.cards { min-height: 155px; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 9px; align-content: flex-start; }
.card { width: 62px; height: 88px; padding: 7px; display: grid; place-items: center; position: relative; border: 2px solid var(--ink); border-radius: 6px; color: var(--ink); background: white; box-shadow: 3px 3px 0 rgba(17,17,15,.22); font-family: "Barlow Condensed", sans-serif; font-size: 35px; font-weight: 900; transform: rotate(var(--tilt, -1deg)); }
.card:nth-child(even) { --tilt: 2deg; }
.card.number-0, .card.number-4, .card.number-8, .card.number-12 { background: var(--yellow); }
.card.number-1, .card.number-5, .card.number-9 { background: var(--pink); color: white; }
.card.number-2, .card.number-6, .card.number-10 { background: var(--blue); color: white; }
.card.number-3, .card.number-7, .card.number-11 { background: var(--orange); color: white; }
.card.plus, .card.times { background: #e6ded0; font-size: 27px; }
.card.chance { width: 76px; background: var(--green); color: white; font-size: 14px; line-height: .9; text-align: center; }
.empty-hand { margin: auto; color: #9c9688; font-family: "Barlow Condensed", sans-serif; font-weight: 700; letter-spacing: .08em; }
.state-stamp { position: absolute; right: 14px; bottom: 12px; padding: 5px 9px; border: 2px solid currentColor; font-family: "Barlow Condensed", sans-serif; font-weight: 900; letter-spacing: .08em; transform: rotate(-4deg); }
.state-stamp.busted { color: #c52c2c; }
.state-stamp.stayed { color: var(--green); }
.unique { position: absolute; left: 16px; bottom: 16px; font-family: "Barlow Condensed", sans-serif; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.controls { position: fixed; z-index: 9; left: 50%; bottom: 28px; transform: translateX(-50%); min-width: min(520px, calc(100vw - 28px)); }
.controls > .primary { margin: 0; box-shadow: 8px 8px 0 var(--yellow); }
.turn-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 10px; background: var(--cream); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.turn-actions button { min-height: 78px; border: 2px solid var(--ink); font-family: "Barlow Condensed", sans-serif; font-size: 28px; font-weight: 900; }
.turn-actions small { display: block; font-size: 11px; letter-spacing: .08em; }
.stay { background: white; }
.hit { background: var(--orange); color: white; }
.turn-actions button:hover { transform: translateY(-3px); box-shadow: 0 5px 0 var(--ink); }
.waiting-note { margin: 0; padding: 13px 18px; background: rgba(17,17,15,.85); color: white; text-align: center; font-size: 13px; border-radius: 2px; }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(17,17,15,.72); backdrop-filter: blur(8px); }
.modal-card { width: min(520px, 100%); padding: 35px; background: var(--cream); border: 3px solid var(--ink); box-shadow: 14px 14px 0 var(--orange); }
.modal-card h2 { margin: 0; font-family: "Barlow Condensed", sans-serif; font-size: 43px; }
.target-list { display: grid; gap: 8px; margin-top: 24px; }
.target-list button { padding: 15px 18px; display: flex; justify-content: space-between; border: 2px solid var(--ink); background: white; font-weight: 800; }
.target-list button:hover { background: var(--yellow); }
.toast { position: fixed; z-index: 50; left: 50%; top: 20px; transform: translate(-50%, -140%); padding: 12px 18px; color: white; background: #c52c2c; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-size: 13px; font-weight: 700; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .landing { grid-template-columns: 1fr; align-content: center; background: linear-gradient(160deg, var(--paper) 0 62%, var(--yellow) 62%); }
  h1 { font-size: clamp(95px, 33vw, 165px); }
  .tagline { margin-top: 30px; }
  .entry-card { box-shadow: 8px 8px 0 var(--ink); }
  .round-bar { grid-template-columns: 55px 1fr 55px; padding-inline: 12px; gap: 8px; }
  .round-bar p { font-size: 13px; }
  .players { grid-template-columns: 1fr; padding: 18px; }
  .player { min-height: 245px; }
  .card { width: 53px; height: 75px; font-size: 29px; }
  .controls { bottom: 14px; }
  .connection { font-size: 0; }
  .connection i { margin: 0; }
}
