* { box-sizing: border-box; }
:root { color-scheme: light; --ink: #203d35; --gold: #d9b86c; --cream: #fffaf0; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% 0, #345a4b 0, #162e29 70%); color: var(--ink); font: 16px/1.5 system-ui, sans-serif; }
.shell { max-width: 920px; margin: auto; padding: 26px 24px 60px; }
.shell-playing { max-width: 1600px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; color: #fff8e9; }
.brand h1, .brand p { margin: 0; }
.brand h1 { font: 700 1.85rem/1.05 Georgia, serif; letter-spacing: .02em; }
.brand p { margin-top: 5px; color: #c5d3c4; font-size: .85rem; }
.brand-decoration { margin-left: auto; color: #d6bd80; letter-spacing: .08em; opacity: .75; }
.crown { display: grid; place-items: center; width: 52px; height: 52px; color: #e0c27d; border: 1px solid #b4985e; border-radius: 50%; font-size: 34px; line-height: 1; }
.panel { background: var(--cream); border: 1px solid #e2d5b9; border-radius: 18px; padding: clamp(24px, 4vw, 42px); margin-bottom: 16px; box-shadow: 0 18px 50px #0619104d; }
h2, h3 { font-family: Georgia, serif; }
h2 { margin: 4px 0 8px; font-size: clamp(1.6rem, 3vw, 2.15rem); line-height: 1.2; }
h3 { margin: 0; font-size: 1.35rem; }
p { margin: 10px 0 16px; }
.eyebrow { display: block; color: #947338; font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
label, .welcome input { display: block; }
label { font-size: .85rem; font-weight: 700; margin: 16px 0 6px; }
input { border: 1px solid #c7c5b5; border-radius: 9px; padding: 12px 14px; background: #fffefa; color: #203d35; font: inherit; max-width: 100%; }
input:focus-visible { outline: 3px solid #d5b86b; outline-offset: 2px; }
.welcome { max-width: 560px; margin: 8vh auto 0; }
.welcome input, .welcome button { width: 100%; }
button { border: 1px solid transparent; border-radius: 9px; background: #1d5845; color: white; font: inherit; font-weight: 700; padding: 11px 20px; cursor: pointer; transition: background-color .15s, transform .15s, box-shadow .15s; }
button:hover:not(:disabled) { background: #123f31; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible { outline: 3px solid #d6a731; outline-offset: 3px; }
.secondary { background: #f3ead5; color: #294d3f; border-color: #d9cba9; }
.secondary:hover:not(:disabled) { background: #eadcc0; }
.welcome button { margin-top: 12px; }
.separator { display: flex; align-items: center; gap: 12px; color: #8d927f; margin: 20px 0 0; font-size: .85rem; }
.separator::before, .separator::after { content: ''; height: 1px; flex: 1; background: #e3dcc9; }
.error { background: #ffebea; color: #8d2922; border-radius: 8px; padding: 12px; }
.notice { background: #fff1c8; color: #604817; padding: 10px 14px; border-radius: 8px; }
.final-notice { border: 2px solid #e8ba4b; font-weight: 800; font-size: 1.1rem; }
.announcement-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: #071b14bf; }
.announcement { width: min(100%, 430px); padding: 28px; border: 2px solid #d6b66f; border-radius: 18px; background: #fffaf0; color: #203d35; text-align: center; box-shadow: 0 18px 60px #0008; }
.room-heading, .round, .section-heading { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.room-heading { background: #f4eedf; border: 1px solid #e8ddc4; padding: 16px 20px; border-radius: 12px; margin: 20px 0 12px; }
.room-heading small, .room-heading strong { display: block; }
.room-heading small { color: #7c806d; font-size: .68rem; font-weight: 800; letter-spacing: .1em; }
.code { letter-spacing: .16em; font-size: 1.5rem; }
.invite { width: 100%; }
.section-heading { margin-top: 26px; }
.section-heading > span { font-size: .8rem; color: #748176; }
.players { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.player { display: flex; align-items: center; gap: 10px; min-width: 160px; max-width: 100%; padding: 9px 13px; border: 1px solid #ddd6c2; background: #f7f2e6; border-radius: 12px; }
.player.active { border-color: #b48b36; box-shadow: inset 0 0 0 1px #b48b36; }
.player-avatar { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 50%; color: #fff8e9; background: #315b4a; font: 700 1rem Georgia, serif; }
.player-info { min-width: 0; }
.player-info strong, .player-info > span { display: block; overflow-wrap: anywhere; }
.player-info strong { font-size: .88rem; }
.player-info > span { color: #6b796e; font-size: .76rem; }
.player-turn { color: #80621f; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.table { padding: clamp(18px, 3vw, 36px); border: 1px solid #b99b5b; border-radius: 24px; background: radial-gradient(ellipse at 50% 20%, #2f7459, #19513e 55%, #123a2e); color: #fff8e9; box-shadow: 0 0 0 7px #563d2a, 0 0 0 9px #b69a64, 0 24px 60px #031b1499; }
.table .eyebrow { color: #e4c986; }
.round { border-bottom: 1px solid #ffffff2e; padding-bottom: 16px; }
.round h2 { margin-bottom: 0; }
.round h2 span { color: #b9cfbd; font-size: .65em; font-weight: 400; }
.badge { background: #f4dfaa; color: #604812; border: 1px solid #d6b66f; border-radius: 25px; padding: 8px 15px; font-weight: 800; }
.badge span { padding-right: 5px; }
.table .players { margin: 16px 0; }
.table .player { background: #102f25a6; border-color: #ffffff30; color: #fff8e9; }
.table .player.active { border-color: #e4c16d; box-shadow: inset 0 0 0 1px #e4c16d; }
.table .player-avatar { background: #c3a55d; color: #1c3e30; }
.table .player-info > span { color: #c2d1c5; }
.table .player-turn { color: #f2d896; }
.table-center { text-align: center; min-height: 265px; padding: 8px 0 20px; }
.turn { font: 700 1.25rem Georgia, serif; margin: 8px 0; }
.turn-help { max-width: 700px; margin: 10px auto 16px; padding: 10px 14px; background: #ffffff16; border: 1px solid #ffffff25; border-radius: 9px; color: #f6f1df; font-size: .9rem; }
.draw-area { display: flex; justify-content: center; gap: clamp(24px, 5vw, 70px); margin-top: 20px; }
.draw-area small { display: block; color: #e1d5b5; font-size: .7rem; font-weight: 800; letter-spacing: .13em; margin-bottom: 8px; }
.pile { width: 108px; height: 150px; color: #fff7dd; background: repeating-linear-gradient(45deg, #873c37, #873c37 7px, #78322f 7px, #78322f 14px); border: 5px double #e4c994; box-shadow: 0 6px 12px #071c1480; }
.pile span { color: #f6d990; font-size: 40px; line-height: 1.4; }
.pile:hover:not(:disabled) { background: #a14a40; transform: translateY(-3px); }
.hand-area { border-top: 1px solid #ffffff38; padding-top: 16px; }
.hand-area .section-heading { margin-top: 0; }
.hand-area .section-heading > span, .hand-area > p:not(.turn-help) { color: #d2e0d2; }
.hand-area > p { font-size: .9rem; }
.hand { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 20px; }
.card-button, .discard-button { flex: 0 0 auto; width: 108px; height: 150px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: inherit; box-shadow: 0 5px 12px #071c1466; }
.card-button:disabled, .discard-button:disabled { opacity: 1; }
.card-button:hover:not(:disabled), .discard-button:hover:not(:disabled) { background: transparent; transform: translateY(-5px); }
.card-button.selected { outline: 3px solid #f3d170; outline-offset: 4px; transform: translateY(-5px); }
.sortable-card { position: relative; display: flex; flex-direction: column; align-items: center; }
.sortable-card > .card-button { touch-action: none; cursor: grab; }
.sortable-card.dragging { opacity: .4; }
.sortable-card.drop-target { filter: drop-shadow(0 0 7px #f2d896); }
.card-button.drag-ghost { position: fixed; z-index: 200; pointer-events: none; margin: 0; transform: rotate(4deg) scale(1.05); box-shadow: 0 14px 28px #071c1499; }
.drawn-card { outline: 3px solid #f2be4d; outline-offset: 3px; }
.drawn-label { position: absolute; z-index: 1; top: -10px; left: 50%; transform: translateX(-50%); border-radius: 5px; background: #f2be4d; color: #2c3020; padding: 1px 6px; font-size: .65rem; font-weight: 800; }
.card-order { display: flex; gap: 4px; margin-top: 6px; }
.card-order button { padding: 2px 12px; background: #0e392a; border-color: #e4c98688; font-size: .8rem; }
.card-face { position: relative; display: block; width: 100%; height: 100%; border: 1px solid #e5dbc6; border-radius: 10px; background: linear-gradient(145deg, #fffefa, #f4eedf); overflow: hidden; }
.card-face::after { content: ''; position: absolute; inset: 5px; border: 1px solid currentColor; border-radius: 6px; opacity: .12; pointer-events: none; }
.card-corner { position: absolute; top: 9px; left: 10px; display: flex; flex-direction: column; align-items: center; line-height: 1; font: 800 21px/1 Georgia, serif; }
.card-corner-bottom { top: auto; left: auto; bottom: 9px; right: 10px; transform: rotate(180deg); }
.card-symbol { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 56px; line-height: 1; }
.card-wild-label { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); color: #684908; background: #ffedb9; border-radius: 4px; padding: 2px 4px; font-size: 9px; font-weight: 800; }
.suit-spade { color: #171717; }
.suit-heart { color: #b1223b; }
.suit-club { color: #236449; }
.suit-diamond { color: #076f95; }
.suit-diamond .card-symbol { color: #1885b0; }
.suit-star { color: #987500; }
.suit-joker { color: #7b3b86; }
.suit-joker .card-corner { font-size: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.meld-list { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.meld-group { max-width: 100%; padding: 12px; border: 1px solid #e4c98688; border-radius: 12px; background: #0e392a88; }
.meld-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.meld-heading strong { color: #f4dfaa; font-size: .9rem; }
.meld-remove { padding: 5px 10px; border-color: #e4c98688; background: transparent; color: #fff8e9; font-size: .8rem; }
.meld-cards { margin: 10px 0 0; }
.meld-card { width: 88px; height: 124px; flex: 0 0 auto; box-shadow: 0 4px 10px #071c1466; border-radius: 10px; }
.turn-actions { margin-top: 18px; }
.table .actions button:not(.secondary) { background: #e7c779; color: #233b2e; }
.table .actions button:not(.secondary):hover:not(:disabled) { background: #f4d995; }
.hand-area .turn-help { margin-left: 0; }
.result { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid #e9dfca; }
.result span { color: #63726a; }
.result + button { margin-top: 16px; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; width: 100%; padding: 12px; background: #ffe3a3; color: #442e00; z-index: 1000; }
#blazor-error-ui a { color: inherit; }
@media (max-width: 600px) {
    .shell { padding: 16px 14px 40px; }
    .brand { margin-bottom: 18px; }
    .brand h1 { font-size: 1.5rem; }
    .brand p { font-size: .75rem; }
    .brand-decoration { display: none; }
    .crown { width: 44px; height: 44px; font-size: 28px; }
    .table { padding: 18px 14px; border-radius: 18px; box-shadow: 0 0 0 4px #563d2a, 0 0 0 5px #b69a64, 0 16px 35px #031b1480; }
    .table-center { min-height: 0; }
    .player { min-width: 0; flex: 1 1 145px; }
    .card-button, .discard-button, .pile { width: 88px; height: 124px; }
    .card-symbol { font-size: 46px; }
    .card-corner { font-size: 18px; }
    .hand { gap: 9px; }
}
@media (prefers-reduced-motion: reduce) { button { transition: none; } }
