/* Woo's motion language: deal, settle, select. All faces remain real SVG. */
:root { --motion-ease: cubic-bezier(.16,1,.3,1); }
.topbar { height: 84px; }
.motion-control { min-width: 44px; min-height: 44px; border: 0; background: transparent; border-radius: 50%; }
.entry-layout { max-width: 1200px; grid-template-columns: 1.1fr 1fr; margin: 32px auto 48px; border-radius: 22px; }
.entry-story { position: relative; overflow: hidden; min-height: 650px; padding: 36px 40px; background: #153e2c; justify-content: flex-start; }
.entry-story::before { content: ""; position: absolute; width: 420px; height: 420px; border: 1px solid #c4d8aa18; border-radius: 50%; top: 145px; left: -135px; pointer-events: none; }
.entry-story .eyebrow { margin: 0 0 18px; font-size: 16px; color: #d9e7bf; }
.entry-story .entry-title { font-size: clamp(38px,4vw,52px); line-height: 1.12; max-width: 440px; margin: 0 0 16px; position: relative; z-index: 1; }
.entry-story > p { color: #cfddcd; max-width: 390px; margin-bottom: 0; }
.entry-foot { margin-top: auto; border: 0; padding-top: 12px; font-size: 16px; }
.entry-form { padding: 40px 44px; }
.mahjong-scene { margin: 0; color: #d9e7bf; position: relative; min-width: 0; }
.scene-art { height: 320px; width: 100%; position: relative; overflow: hidden; isolation: isolate; }
.scene-table { position: absolute; left: 50%; top: 58%; width: 300px; height: 170px; transform: translate(-50%,-50%) rotate(-15deg) skew(9deg,9deg); background: #22583e; border: 1px solid #87a16c55; border-radius: 36px; box-shadow: 0 14px 0 #0d2c21, 0 24px 30px #071c1955, inset 0 0 0 13px #2b6044; z-index: -1; }
.scene-table-mark { position: absolute; left: 42%; top: 63%; font-weight: 800; font-size: 34px; letter-spacing: -.08em; color: #8aa87655; }
.scene-orbit { position: absolute; width: 400px; height: 260px; border: 1px solid #d9e7bf25; border-radius: 50%; left: 50%; top: 52%; transform: translate(-50%,-50%) rotate(-13deg); }
.scene-orbit span { position: absolute; font: 22px serif; color: #c7d8ae70; }
.scene-orbit span:nth-child(1) { top: -16px; left: 48%; }
.scene-orbit span:nth-child(2) { top: 45%; right: -12px; }
.scene-orbit span:nth-child(3) { bottom: -13px; left: 48%; }
.scene-orbit span:nth-child(4) { top: 45%; left: -12px; }
.scene-deck { position: absolute; width: 400px; height: 250px; left: calc(50% - 200px); top: 30px; z-index: 2; }
.scene-piece { width: 78px; height: 108px; position: absolute; top: 70px; left: 50%; border-radius: 10px; background: #aabd86; box-shadow: 0 8px 0 #82a26a, 0 10px 0 #0d2c2140, 0 18px 22px #051d2440; transform-origin: 50% 100%; }
.scene-face { position: absolute; inset: 0 0 7px; background: linear-gradient(130deg,#fffff9,#eeefdc); border: 1px solid #fff; border-radius: 10px 10px 7px 7px; display: grid; place-items: center; box-shadow: inset 0 -2px 0 #d5dcc7; }
.scene-face svg { height: 87%; width: 87%; }
.piece-0 { transform: translate(-192px,34px) rotate(-28deg); z-index: 1; }
.piece-1 { transform: translate(-143px,5px) rotate(-18deg); z-index: 2; }
.piece-2 { transform: translate(-92px,-15px) rotate(-9deg); z-index: 3; }
.piece-3 { transform: translate(-39px,-34px); z-index: 7; }
.piece-4 { transform: translate(14px,-15px) rotate(9deg); z-index: 5; }
.piece-5 { transform: translate(65px,5px) rotate(18deg); z-index: 4; }
.piece-6 { transform: translate(114px,34px) rotate(28deg); z-index: 3; }
.scene-shadow { position: absolute; width: 230px; height: 20px; border-radius: 50%; background: #09271e45; top: 218px; left: calc(50% - 115px); z-index: 1; }
.mahjong-scene figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; padding: 0 4px 12px; }
.deal-button { background: #ffffff0b; border: 1px solid #d9e7bf45; color: #ecf2dc; padding: 8px 14px; min-height: 44px; border-radius: 7px; font-size: 16px; }
.deal-button svg { width: 19px; height: 19px; }
.deal-button:hover { background: #ffffff17; }
.deal-button:active svg { transform: rotate(45deg); }
.deal-button svg { transition: transform 280ms var(--motion-ease); }
.table-card { transition: transform 220ms var(--motion-ease), border-color 180ms, background 180ms, box-shadow 220ms; }
.table-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px #1735280b; }
.table-card-bottom .icon:last-child { transition: transform 220ms var(--motion-ease); }
.table-card:hover .table-card-bottom .icon:last-child { transform: translateX(4px); }
.table-card:active { transform: translateY(0) scale(.99); }
.desktop-nav a, .bottom-nav a { transition: color 160ms, background 160ms; }
.button, button { transition: background 160ms, transform 180ms var(--motion-ease), border-color 160ms, box-shadow 160ms; }
.button:active, button:active { transform: scale(.98); }
.player-panel { transition: background 280ms, border-color 280ms; }
.player-score { transform-origin: left center; }
.winner-choice.selected { background: #e1eabc; border-color: #82985d; box-shadow: inset 0 0 0 1px #82985d; }
.tile { transition: transform 150ms var(--motion-ease), background 150ms, border-color 150ms; }
.tile:not(:disabled):hover { transform: translateY(-4px) rotate(-2deg); box-shadow: 0 6px 8px #17352818; }
.tile:not(:disabled):active { transform: translateY(1px) scale(.96); }
.hand-tray { background: #e6ecd8; border: 0; box-shadow: inset 0 3px 7px #1a3d2310; }
dialog[open] { animation: woo-dialog 240ms var(--motion-ease); }
dialog[open]::backdrop { animation: woo-backdrop 180ms ease-out; }
@keyframes woo-dialog { from { opacity: .5; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes woo-backdrop { from { background: #10271f00; } to { background: #10271f80; } }
@media (max-width: 1240px) { .entry-layout { margin: 24px; } }
@media (max-width: 950px) {
  .entry-layout { grid-template-columns: 1fr 1fr; }
  .entry-story { padding: 32px 26px; }
  .entry-story .entry-title { font-size: 38px; }
  .entry-form { padding: 30px; }
  .scene-deck { scale: .8; }
  .scene-orbit { width: 290px; height: 230px; }
  .scene-table { width: 260px; height: 150px; }
  .mahjong-scene figcaption > span { max-width: 165px; }
  .top-actions { gap: 8px; }
}
@media (max-width: 700px) {
  .topbar { height: 74px; padding: 0 18px; }
  .brand-caption { display: none; }
  .brand { min-width: 80px; }
  .desktop-nav { display: none; }
  .entry-layout { display: flex; flex-direction: column; margin: 18px 16px 24px; border-radius: 16px; }
  .entry-story, .entry-setup .entry-story { display: block; padding: 24px 24px 12px; min-height: 0; }
  .entry-story .eyebrow { display: none; }
  .entry-story .entry-title { display: block; font-size: 30px; line-height: 1.15; margin-bottom: 0; max-width: 300px; }
  .entry-story .entry-title br { display: none; }
  .entry-story > p, .entry-foot { display: none; }
  .scene-art { height: 210px; }
  .scene-deck { top: -14px; scale: .68; }
  .scene-table { top: 55%; width: 225px; height: 110px; border-radius: 24px; box-shadow: 0 9px 0 #0d2c21, 0 16px 20px #071c1933, inset 0 0 0 9px #2b6044; }
  .scene-table-mark { font-size: 24px; }
  .scene-orbit { width: 280px; height: 166px; }
  .scene-orbit span { font-size: 18px; }
  .scene-shadow { top: 142px; width: 180px; left: calc(50% - 90px); }
  .mahjong-scene figcaption { padding-bottom: 2px; }
  .mahjong-scene figcaption > span { display: none; }
  .deal-button { margin-left: auto; margin-top: -38px; z-index: 3; background: #153e2c; }
  .entry-form, .entry-setup .entry-form { padding: 26px 24px; }
  .entry-form .eyebrow { display: none; }
  .entry-form h1 { font-size: 26px; }
  .entry-form form { margin-top: 20px; }
  .entry-form label { margin-bottom: 16px; }
  .entry-form .code-input { height: 60px; }
  .connection { display: none; }
  .motion-control { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.motion-paused *, .motion-paused *::before, .motion-paused *::after { animation: none !important; transition: none !important; }

/* The playing room gets a short tabletop banner; score pages remain task-focused. */
.room-header { display: grid; grid-template-columns: minmax(0,1fr) 350px; align-items: center; background: #153e2c; color: #fffff6; border-radius: 18px; padding: 28px 32px; margin-bottom: 26px; gap: 24px; overflow: hidden; }
.room-copy { min-width: 0; }
.room-copy .eyebrow { color: #d9e7bf; font-size: 16px; margin-bottom: 12px; }
.room-copy h1 { font-size: 36px; margin-bottom: 12px; }
.room-copy p { color: #cbdcca; max-width: 440px; }
.room-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-top: 22px; }
.room-stats span { display: flex; align-items: baseline; gap: 8px; font-size: 16px; color: #d5e0ca; }
.room-stats strong { font-size: 24px; color: #edf4d4; font-weight: 700; }
.scene-compact .scene-art { height: 210px; }
.scene-compact .scene-deck { top: -15px; scale: .65; }
.scene-compact .scene-table { width: 240px; height: 125px; }
.scene-compact .scene-orbit { width: 310px; height: 175px; }
.scene-compact .scene-shadow { top: 145px; }
.scene-compact figcaption { display: none; }
.mahjong-scene { container-type: inline-size; container-name: mahjong; }
@container mahjong (max-width: 470px) { .scene-deck, .scene-compact .scene-deck { scale: .84; } }
@container mahjong (max-width: 400px) { .scene-deck, .scene-compact .scene-deck { scale: .72; } }
@container mahjong (max-width: 350px) { .scene-deck, .scene-compact .scene-deck { scale: .60; } }
@container mahjong (max-width: 300px) { .scene-deck, .scene-compact .scene-deck { scale: .50; } }
@container mahjong (max-width: 200px) {
  .scene-deck { scale: .30; top: -63px; }
  .scene-table { width: 110px; height: 70px; border-radius: 18px; box-shadow: 0 7px 0 #0d2c21, inset 0 0 0 6px #2b6044; }
  .scene-table-mark { display: none; }
  .scene-orbit { width: 140px; height: 100px; }
  .scene-shadow { display: none; }
}
@media (max-width: 950px) {
  .room-header { grid-template-columns: minmax(0,1fr) 250px; padding: 24px; gap: 12px; }
  .scene-compact .scene-orbit { width: 230px; }
}
@media (max-width: 700px) {
  .entry-story .entry-title { font-size: 26px; }
  .entry-setup .entry-story { padding: 8px 20px; }
  .entry-setup .entry-title { display: none; }
  .entry-setup .scene-art { height: 128px; }
  .entry-setup .scene-deck { scale: .46; top: -60px; left: calc(44% - 200px); }
  .entry-setup .scene-table { width: 170px; height: 78px; left: 44%; top: 58%; }
  .entry-setup .scene-orbit { width: 230px; height: 108px; left: 44%; }
  .entry-setup .scene-orbit span { font-size: 14px; }
  .entry-setup .scene-shadow { display: none; }
  .entry-setup .deal-button { position: absolute; bottom: 4px; right: 0; padding: 8px; }
  .entry-setup .deal-button > span { display: none; }
  .entry-setup .deal-button svg { width: 24px; height: 24px; }
  .room-header { grid-template-columns: minmax(0,1fr) 128px; padding: 20px; gap: 4px; margin-bottom: 22px; border-radius: 12px; }
  .room-copy .eyebrow { font-size: 12px; margin-bottom: 10px; }
  .room-copy h1 { font-size: 28px; }
  .room-copy p { display: none; }
  .room-stats { gap: 6px 12px; margin-top: 12px; }
  .room-stats strong { font-size: 20px; }
  .room-stats span { font-size: 14px; gap: 5px; }
  .scene-compact .scene-art { height: 140px; }
  .scene-compact .scene-deck { top: -56px; scale: .26; }
  .scene-compact .scene-table { width: 108px; height: 65px; }
  .scene-compact .scene-orbit { width: 122px; height: 100px; }
  .scene-compact .scene-orbit span { font-size: 14px; }
  .scene-compact .scene-shadow { display: none; }
}

/* Final responsive polish: navigation has no gap between breakpoints. */
@media (min-width: 601px) and (max-width: 700px) {
  .desktop-nav { display: flex; gap: 14px; }
  .desktop-nav .icon { display: none; }
  .desktop-nav a { font-size: 16px; }
  .topbar { gap: 12px; }
  .top-actions { gap: 3px; }
}
@media (max-width: 950px) {
  .mahjong-scene figcaption > span { display: none; }
  .mahjong-scene figcaption { justify-content: flex-end; }
}
@media (max-width: 700px) {
  .entry-setup .scene-art { height: 98px; }
  .entry-setup .scene-deck { top: -76px; scale: .39; }
  .entry-setup .scene-table { width: 150px; height: 60px; }
  .entry-setup .scene-orbit { width: 210px; height: 84px; }
  .entry-setup .entry-form { padding-top: 20px; padding-bottom: 20px; }
  .entry-setup .entry-form label { margin-bottom: 14px; }
}
