:root {
  --ink: #4c3c48;
  --muted: #88747f;
  --rose: #c9687d;
  --rose-dark: #a94f66;
  --blush: #f5d9df;
  --cream: #fffaf5;
  --paper: rgba(255, 253, 249, 0.92);
  --sage: #afc4ac;
  --gold: #d5a561;
  --line: rgba(101, 73, 87, 0.14);
  --shadow: 0 22px 60px rgba(101, 56, 72, 0.12);
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: #fff9f5;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: radial-gradient(circle at 15% 5%, #fae7e9 0, transparent 32rem), linear-gradient(155deg, #fffaf5, #fff8f3 56%, #f9e9e7); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(201, 104, 125, .3); outline-offset: 3px; }
.hidden { display: none !important; }
.button-reset { border: 0; background: none; cursor: pointer; }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(4px); pointer-events: none; }
.ambient-one { width: 22rem; height: 22rem; top: 22%; right: -12rem; background: rgba(242, 195, 205, .28); }
.ambient-two { width: 19rem; height: 19rem; bottom: -10rem; left: 12%; background: rgba(218, 203, 174, .2); }

.landing { width: min(1180px, calc(100% - 40px)); margin: auto; min-height: 100vh; }
.landing-nav, .app-header { height: 88px; display: flex; align-items: center; justify-content: space-between; }
.wordmark { color: var(--ink); font: 700 1.05rem "Fraunces", Georgia, serif; text-decoration: none; letter-spacing: -.03em; }
.wordmark span { color: var(--rose); font-style: italic; }
.wordmark b { color: var(--rose); font-size: 1.25rem; }
.distance-pill, .connection-pill { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.distance-pill i, .connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px rgba(175, 196, 172, .2); }
.connection-pill.offline i { background: var(--rose); }

.hero { min-height: calc(100vh - 180px); padding: 7vh 2%; display: grid; grid-template-columns: 1.04fr .96fr; align-items: center; gap: clamp(3rem, 8vw, 8rem); }
.eyebrow { color: var(--rose-dark); font-size: .69rem; font-weight: 800; letter-spacing: .19em; margin: 0 0 15px; }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; }
h1 { font-size: clamp(3.3rem, 6vw, 6.4rem); line-height: .92; letter-spacing: -.055em; margin: 0; }
h1 em { color: var(--rose); font-weight: 600; }
.hero-text { max-width: 600px; color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.75; margin: 32px 0; }
.create-form { max-width: 630px; }
.create-form label { display: block; font-weight: 700; font-size: .84rem; margin-bottom: 10px; }
.input-row { display: flex; padding: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.75); border-radius: 18px; box-shadow: 0 10px 28px rgba(91, 57, 67, .07); }
input { min-width: 0; border: 1px solid var(--line); background: #fffdfb; color: var(--ink); border-radius: 12px; padding: 13px 15px; }
.input-row input { flex: 1; border: 0; background: transparent; }
.primary-button, .secondary-button { border: 0; border-radius: 12px; padding: 13px 18px; font-weight: 700; cursor: pointer; transition: transform .2s, box-shadow .2s, background .2s; }
.primary-button { background: var(--rose); color: white; box-shadow: 0 8px 18px rgba(185, 81, 106, .2); }
.primary-button:hover { transform: translateY(-2px); background: var(--rose-dark); box-shadow: 0 11px 22px rgba(185, 81, 106, .26); }
.form-note { color: #a18e97; font-size: .76rem; margin: 9px 8px; }

.hero-art { position: relative; height: 470px; }
.postcard { position: absolute; width: 58%; aspect-ratio: .82; padding: 24px; background: #fffdfa; border: 1px solid rgba(101,73,87,.1); box-shadow: var(--shadow); text-align: center; }
.card-left { top: 4%; left: 0; transform: rotate(-6deg); }
.card-right { right: 0; bottom: 2%; transform: rotate(5deg); }
.tiny-label { display: block; text-align: left; font-size: .6rem; letter-spacing: .16em; color: var(--muted); }
.moon, .sun { display: grid; place-items: center; height: 74%; margin-top: 8px; background: linear-gradient(145deg, #efd8dd, #f8eee8); color: #b85e75; font: 5rem "Fraunces"; }
.sun { background: linear-gradient(145deg, #eee6cc, #f8eee8); color: var(--gold); }
.postcard p { font-family: "Fraunces"; font-style: italic; margin: 12px 0; }
.tape { position: absolute; z-index: 3; width: 78px; height: 24px; background: rgba(220,190,172,.48); }
.tape-one { left: 19%; top: 0; transform: rotate(8deg); }.tape-two { right: 17%; bottom: 1%; transform: rotate(-7deg); }
.heart-path { position: absolute; z-index: 4; left: 43%; top: 40%; display: flex; flex-direction: column; color: var(--rose); transform: rotate(21deg); }
.heart-path span:nth-child(2) { margin-left: 24px; font-size: 1.4rem; }.heart-path span:nth-child(3) { margin-left: 48px; }
.preview-strip { border-top: 1px solid var(--line); padding: 25px 0 38px; text-align: center; }
.preview-strip > p { color: var(--muted); font: italic 1rem "Fraunces"; }
.preview-games { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.preview-games span { padding: 8px 13px; border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.52); border: 1px solid var(--line); font-size: .75rem; }

.room-app { width: min(1120px, calc(100% - 36px)); margin: auto; padding-bottom: 70px; }
.app-header { border-bottom: 1px solid var(--line); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.icon-button { width: 39px; height: 39px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.65); cursor: pointer; }
.icon-button.active { background: var(--rose); color: white; }
.couple-banner { margin: 28px 0 42px; display: grid; grid-template-columns: 1fr 130px 1fr; align-items: center; }
.player-card { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 14px 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 9px 28px rgba(93,57,69,.06); }
.player-card > b { margin-left: auto; color: var(--rose); font: 700 1.7rem "Fraunces"; }
.partner-player { justify-content: flex-end; text-align: right; }.partner-player > b { margin-left: 0; margin-right: auto; }
.avatar { flex: 0 0 auto; display: grid; place-items: center; width: 41px; height: 41px; border-radius: 50%; background: var(--blush); color: var(--rose-dark); }
.player-card small { display: block; color: var(--muted); font-size: .58rem; font-weight: 800; letter-spacing: .14em; }
.player-card strong { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-card.offline { opacity: .55; }
.together-mark { text-align: center; color: var(--muted); font: italic .75rem "Fraunces"; }.together-mark span { display: block; }.together-mark b { display: block; color: var(--rose); font-size: 2rem; line-height: .7; }
.content-view { animation: fade-up .35s ease both; }
.section-heading, .game-topbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading h2, .game-topbar h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.1rem); letter-spacing: -.035em; }
.secondary-button { background: transparent; border: 1px solid var(--rose); color: var(--rose-dark); }
.secondary-button:hover { background: var(--blush); }
.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.game-card { position: relative; min-height: 205px; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); text-align: left; cursor: pointer; box-shadow: 0 8px 30px rgba(89,54,66,.055); transition: transform .24s, box-shadow .24s, border-color .24s; }
.game-card:hover { transform: translateY(-5px); border-color: rgba(201,104,125,.36); box-shadow: var(--shadow); }
.game-card-icon { display: grid; place-items: center; width: 57px; height: 57px; border-radius: 16px; background: var(--card-color, var(--blush)); font-size: 1.7rem; }
.game-card h3 { margin: 25px 0 5px; font-size: 1.22rem; }.game-card p { margin: 0; color: var(--muted); font-size: .81rem; line-height: 1.45; }
.game-card .arrow { position: absolute; right: 19px; bottom: 18px; color: var(--rose); }
.lobby-bottom { display: grid; grid-template-columns: 1.35fr .65fr; gap: 17px; margin-top: 18px; }
.history-card, .note-card { min-height: 180px; padding: 22px; background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 20px; }
.card-heading { display: flex; justify-content: space-between; align-items: baseline; }.card-heading h3 { margin: 0; }.card-heading span, .empty-copy { color: var(--muted); font-size: .76rem; }
.history-list { margin-top: 16px; }.history-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .82rem; }.history-row span { color: var(--muted); }
.note-card { background: linear-gradient(135deg, #efd6dc, #f8e8df); transform: rotate(1deg); }.note-card > span { color: var(--rose-dark); font-size: .58rem; font-weight: 800; letter-spacing: .17em; }.note-card blockquote { margin: 21px 0 12px; font: italic 1.15rem/1.45 "Fraunces"; }.note-card p { color: var(--muted); font-size: .75rem; }

.game-topbar { align-items: center; }.game-topbar > div { text-align: center; }.game-topbar .eyebrow { margin-bottom: 4px; }.game-topbar h2 { font-size: 2.1rem; }
.back-button, .text-button { border: 0; background: transparent; color: var(--rose-dark); cursor: pointer; font-weight: 700; }
.turn-label { min-width: 100px; text-align: right; color: var(--muted); font-size: .78rem; }
.game-stage { min-height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(20px, 5vw, 55px); background: rgba(255,255,255,.58); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.status-copy { min-height: 28px; color: var(--muted); text-align: center; margin: 0 0 20px; }
.board { display: grid; gap: 8px; }
.ttt-board { grid-template-columns: repeat(3, minmax(70px, 110px)); }
.board-button { aspect-ratio: 1; border: 0; border-radius: 16px; background: #fffaf7; box-shadow: inset 0 0 0 1px var(--line), 0 5px 12px rgba(80,50,60,.06); cursor: pointer; font: 700 2.8rem "Fraunces"; color: var(--rose); }
.board-button.partner { color: #7e9b88; }.board-button:disabled { cursor: default; }
.connect-board { display: grid; grid-template-columns: repeat(7, minmax(34px, 58px)); gap: 7px; padding: 14px; border-radius: 22px; background: #e3b4bf; box-shadow: inset 0 -7px 0 rgba(139,78,95,.12); }
.connect-cell { aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: #fff9f5; box-shadow: inset 0 3px 6px rgba(89,54,66,.14); cursor: pointer; }.connect-cell.creator { background: #c9687d; }.connect-cell.partner { background: #8dac96; }
.memory-board { grid-template-columns: repeat(4, minmax(56px, 88px)); perspective: 900px; }.memory-card { aspect-ratio: .82; border: 0; border-radius: 13px; background: linear-gradient(145deg, #da8da0, #bd6379); color: transparent; cursor: pointer; font-size: 1.75rem; box-shadow: 0 5px 12px rgba(98,52,67,.12); }.memory-card.revealed { color: var(--ink); background: #fffaf5; box-shadow: inset 0 0 0 1px var(--line); transform: rotateY(0); }
.round-score { display: flex; gap: 12px; margin-bottom: 20px; }.round-score span { padding: 7px 12px; border-radius: 999px; background: var(--blush); font-size: .78rem; }
.word-puzzle { text-align: center; }.scrambled-word { margin: 8px 0 3px; color: var(--rose-dark); font: 700 clamp(2.2rem, 8vw, 4.8rem) "Fraunces"; letter-spacing: .17em; text-transform: uppercase; }.hint { color: var(--muted); }.guess-form { display: flex; gap: 8px; width: min(430px, 100%); margin-top: 24px; }.guess-form input { flex: 1; }
.timer { position: relative; width: 62px; height: 62px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 50%; background: conic-gradient(var(--rose) var(--progress, 100%), var(--blush) 0); font-weight: 800; }.timer::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fffaf7; }.timer span { position: relative; }
.reaction-zone { width: min(480px, 100%); min-height: 290px; display: grid; place-items: center; border: 2px dashed rgba(201,104,125,.35); border-radius: 28px; text-align: center; background: #fffaf7; }.reaction-zone.go { background: #dcebdc; border-color: #7aa182; }.reaction-button { width: 160px; height: 160px; border: 0; border-radius: 50%; background: var(--rose); color: white; cursor: pointer; font: 700 1.4rem "Fraunces"; box-shadow: 0 14px 0 #a94f66, 0 22px 32px rgba(117,54,70,.18); }.reaction-button:active { transform: translateY(8px); box-shadow: 0 6px 0 #a94f66; }
.draw-layout { display: grid; grid-template-columns: minmax(0, 560px) 230px; width: 100%; gap: 18px; align-items: start; }.canvas-wrap { position: relative; width: 100%; aspect-ratio: 4/3; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }.draw-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }.draw-side { display: flex; flex-direction: column; gap: 12px; }.word-secret { padding: 14px; border-radius: 14px; background: var(--blush); text-align: center; }.word-secret b { display: block; font: 700 1.35rem "Fraunces"; color: var(--rose-dark); }.palette { display: flex; gap: 8px; }.color-dot { width: 29px; height: 29px; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }.color-dot.active { box-shadow: 0 0 0 3px var(--rose); }
.match-result { text-align: center; }.match-result .big-heart { font-size: 4.5rem; animation: heartbeat 1.5s infinite; }.match-result h3 { font-size: 2.2rem; margin: 4px 0; }.match-result p { color: var(--muted); }.result-actions { display: flex; gap: 10px; justify-content: center; margin-top: 25px; }

.toast { position: fixed; z-index: 20; left: 50%; top: 22px; transform: translate(-50%, -100px); padding: 11px 17px; border-radius: 12px; background: var(--ink); color: white; font-size: .82rem; box-shadow: var(--shadow); transition: transform .3s; }.toast.show { transform: translate(-50%, 0); }
.modal { width: min(500px, calc(100% - 30px)); padding: 35px; border: 1px solid var(--line); border-radius: 24px; background: #fffaf7; color: var(--ink); box-shadow: 0 30px 100px rgba(70,35,48,.25); text-align: center; }.modal::backdrop { background: rgba(63,43,52,.34); backdrop-filter: blur(5px); }.modal h2 { margin: 5px 0 9px; font-size: 1.9rem; }.modal p { color: var(--muted); }.modal-icon { font-size: 2rem; }.modal-close { position: absolute; right: 15px; top: 12px; border: 0; background: transparent; cursor: pointer; font-size: 1.5rem; }.copy-row { display: flex; gap: 7px; margin: 22px 0 11px; }.copy-row input { flex: 1; font-size: .75rem; }.stack-form { display: grid; gap: 10px; margin-top: 22px; }

@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes heartbeat { 0%, 35%, 100% { transform: scale(1); } 12% { transform: scale(1.12); } }
@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; padding-top: 5vh; }.hero-art { height: 380px; max-width: 500px; width: 100%; margin: auto; }.game-grid { grid-template-columns: repeat(2, 1fr); }.lobby-bottom { grid-template-columns: 1fr; }.draw-layout { grid-template-columns: 1fr; }.draw-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 570px) {
  .landing, .room-app { width: min(100% - 24px, 1120px); }.landing-nav { height: 70px; }.distance-pill { display: none; }.hero { min-height: auto; padding: 55px 4px 35px; gap: 50px; } h1 { font-size: 3.2rem; }.input-row { display: grid; gap: 5px; }.input-row input { min-height: 48px; }.hero-art { height: 320px; }.postcard { padding: 15px; }.preview-games span:nth-child(n+5) { display: none; }
  .app-header { height: 66px; }.connection-pill > span { display: none; }.couple-banner { grid-template-columns: 1fr 35px 1fr; margin: 19px 0 33px; }.player-card { padding: 10px; gap: 7px; }.avatar { display: none; }.player-card > b { font-size: 1.2rem; }.player-card strong { max-width: 90px; }.together-mark span { display: none; }.section-heading { align-items: start; }.section-heading h2 { font-size: 2rem; }.game-grid { grid-template-columns: 1fr; gap: 11px; }.game-card { min-height: 124px; padding: 16px 16px 16px 91px; }.game-card-icon { position: absolute; left: 17px; top: 18px; }.game-card h3 { margin: 9px 0 4px; }.game-stage { padding: 22px 10px; min-height: 460px; }.game-topbar { display: grid; grid-template-columns: 60px 1fr 60px; }.game-topbar h2 { font-size: 1.55rem; }.turn-label { min-width: 0; font-size: .65rem; }.ttt-board { grid-template-columns: repeat(3, 80px); }.connect-board { gap: 4px; padding: 9px; }.memory-board { gap: 6px; }.draw-side { grid-template-columns: 1fr; }.guess-form { flex-direction: column; }.modal { padding: 30px 20px; }.copy-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
