.durak-shell { position: relative; width: min(1500px, calc(100% - 64px)); margin: 0 auto; padding-bottom: 24px; }
.durak-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 22px 0; }
.durak-header a { color: var(--text); text-decoration: none; font-size: 14px; }.durak-header h1 { margin: 0; font-size: 28px; letter-spacing: -.04em; }.durak-header h1 span { margin-left: 12px; font-size: 12px; font-weight: 500; letter-spacing: 0; }
.durak-header button { font: inherit; color: var(--text); background: #ffffffa0; border: 1px solid white; border-radius: 12px; padding: 12px 16px; cursor: pointer; }
.durak-page [hidden] { display: none !important; }.durak-page button:disabled { cursor: default; opacity: .45; }.durak-page :focus-visible { outline: 3px solid #9e492f; outline-offset: 4px; }
.durak-panel { border-radius: 24px; border: 1px solid #ffffffcc; background: rgba(255,255,255,.88); padding: 28px; box-shadow: 0 12px 40px #333b6010; backdrop-filter: blur(18px); }
.durak-panel h2 { margin: 0 0 16px; font-size: 28px; letter-spacing: -.04em; }.durak-muted { color: #68718a; font-size: 13px; line-height: 1.6; }
.durak-feedback { padding: 14px 18px; background: #fff3d6; border: 1px solid #d4bc83; border-radius: 12px; font-size: 14px; }.durak-feedback:empty { display: none; }
.join-panel { max-width: 460px; margin: 36px auto; }.join-panel p { line-height: 1.6; }.join-panel form { display: grid; gap: 12px; }.join-panel label { margin-top: 8px; font-weight: 650; font-size: 14px; }.join-panel input { width: 100%; min-width: 0; padding: 14px; border: 1px solid #c9ced8; border-radius: 12px; font: inherit; font-size: 18px; background: #fff; color: var(--text); }#room-code { text-transform: uppercase; letter-spacing: .12em; }
.durak-primary, .durak-secondary { padding: 14px 22px; border-radius: 12px; font: inherit; font-weight: 650; font-size: 15px; cursor: pointer; min-height: 48px; }.durak-primary { background: var(--text); color: white; border: 1px solid var(--text); }.durak-secondary { background: #fff; border: 1px solid #c9ced8; color: var(--text); }
.join-panel .durak-primary { margin-top: 12px; }.room-topline { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; font-size: 14px; }.connection-ok { color: #206648; }.connection-lost { color: #9b462d; }
.durak-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }.durak-layout:has(.invite-panel[hidden]):has(.game-sidebar[hidden]) { grid-template-columns: 1fr; }
.table-panel { min-height: 530px; }.table-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }.table-heading .games-eyebrow { margin-bottom: 8px; }
#deck-label { display: flex; align-items: center; justify-content: flex-end; gap: 10px; max-width: 250px; font-size: 12px; line-height: 1.6; }
.durak-players { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 20px; }.durak-player { display: flex; align-items: center; gap: 10px; background: #eef0f5; border: 1px solid transparent; border-radius: 14px; padding: 12px; min-width: 140px; position: relative; }.durak-player.is-you { background: #e5efff; border-color: #9cb9e0; }.durak-player.is-defender { border-color: #b6905b; background: #fff0d9; }.player-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; flex-shrink: 0; font-weight: 700; }.durak-player strong { display: block; font-size: 14px; overflow-wrap: anywhere; }.durak-player small { display: block; font-size: 11px; margin-top: 3px; color: #647089; }.durak-player .player-online { color: #357254; }.durak-player .player-offline { color: #975c25; }.remove-player { border: 0; background: transparent; font: inherit; font-size: 22px; color: #6b7387; cursor: pointer; padding: 8px; }
.turn-message { font-size: 18px; font-weight: 650; line-height: 1.5; margin: 22px 0; }.lobby-help { text-align: center; padding: 24px 0; }.lobby-help > span { font-size: 32px; letter-spacing: .2em; color: #b78b70; }.lobby-help h3 { font-size: 23px; margin-bottom: 12px; }.lobby-help p { color: #68718a; line-height: 1.7; font-size: 15px; }.host-controls { margin-top: 20px; }.host-controls .durak-primary { min-width: 220px; }
.invite-panel { text-align: center; }.invite-panel h2 { font-size: 25px; }.invite-panel img { display: block; width: min(100%, 240px); height: auto; margin: 20px auto; background: #fff; border-radius: 12px; }.invite-panel > p { font-size: 14px; line-height: 1.6; }.invite-panel .durak-muted { font-size: 12px; }.invite-code { margin: 20px 0 12px; }.invite-code small { display: block; color: #68718a; font-size: 12px; margin-bottom: 8px; }.invite-code strong { font-size: 30px; letter-spacing: .15em; }.invite-link { display: block; overflow-wrap: anywhere; font-size: 12px; color: #515d78; line-height: 1.6; margin: 12px 0; }.invite-panel button { width: 100%; }
.durak-card { position: relative; width: 80px; height: 116px; flex-shrink: 0; border: 1px solid #d5d9e2; border-radius: 10px; background: #fffdf7; color: #2d3557; box-shadow: 0 4px 8px #26334d15; font-family: Georgia, serif; padding: 0; }.red-card { color: #c4514e; }.durak-card-corner { position: absolute; top: 8px; left: 9px; font-size: 18px; }.durak-card-suit { display: grid; place-items: center; width: 100%; height: 100%; font-size: 44px; padding-top: 14px; }.durak-card.trump-card { width: 44px; height: 64px; border-radius: 6px; }.trump-card .durak-card-corner { font-size: 11px; top: 3px; left: 4px; }.trump-card .durak-card-suit { font-size: 24px; }
.durak-table-cards { display: flex; flex-wrap: wrap; gap: 22px; padding: 12px 0 22px; min-height: 150px; }.durak-table-cards:empty { display: none; }.table-pair { position: relative; width: 104px; height: 150px; }.defense-card { position: absolute; top: 26px; left: 24px; transform: rotate(9deg); }.target-card { outline: 3px solid #d3913b; outline-offset: 3px; }.durak-table-cards button { cursor: pointer; }
.hand-panel { margin-top: 20px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }.hand-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }.hand-heading h2 { font-size: 23px; margin: 0; }.hand-heading > span { font-size: 13px; color: #93612c; font-weight: 650; }.durak-hand { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }.durak-hand button { cursor: pointer; transition: transform .15s; }.durak-hand button:disabled { opacity: .6; }.durak-hand .selected-card { transform: translateY(-8px); outline: 3px solid #bf743c; outline-offset: 2px; opacity: 1; }.player-actions { display: flex; flex-wrap: wrap; gap: 12px; min-height: 48px; }.durak-result { display: grid; flex: 1; place-items: center; padding: 40px 0; text-align: center; font-size: clamp(36px, 5vw, 72px); line-height: 1.15; font-weight: 750; letter-spacing: -.04em; overflow-wrap: anywhere; }
@media (max-width: 800px) { .durak-shell { width: calc(100% - 28px); }.durak-layout { grid-template-columns: 1fr; }.durak-header h1 span { display: none; }.durak-panel { padding: 20px; }.table-panel { min-height: 0; }.durak-header { padding: 18px 0; }.durak-header h1 { font-size: 24px; }.table-heading h2 { font-size: 23px; }#deck-label { max-width: 170px; font-size: 10px; }.durak-players { gap: 8px; }.durak-player { min-width: 0; padding: 8px; flex: 1 1 130px; gap: 8px; }.durak-player strong { font-size: 13px; }.player-avatar { width: 28px; height: 28px; }.turn-message { font-size: 16px; }.durak-card { width: 65px; height: 96px; }.durak-card-corner { font-size: 15px; }.durak-card-suit { font-size: 34px; }.table-pair { width: 85px; height: 125px; }.defense-card { left: 18px; top: 22px; }.durak-table-cards { gap: 15px; min-height: 0; }.hand-heading { align-items: flex-start; flex-direction: column; gap: 6px; }.hand-heading h2 { font-size: 20px; }.durak-hand { gap: 10px; }.player-actions button { flex: 1; }.lobby-help { padding: 12px 0; }.lobby-help h3 { font-size: 20px; }.lobby-help p { font-size: 13px; }.join-panel { margin-top: 20px; } }
@media (prefers-reduced-motion: reduce) { .durak-hand button { transition: none; } }

/* The shared table and the player column during a game. */
.active-table { display: flex; flex-direction: column; min-width: 0; }
.active-table .table-surface { display: flex; flex: 1; flex-direction: column; min-height: 360px; }
.active-table .durak-table-cards { flex: 1; align-content: center; justify-content: center; padding: 28px 0; }
#deck-label.table-deck { justify-content: flex-start; max-width: none; gap: 16px; margin-top: auto; padding: 16px; border: 1px solid #d9dde5; border-radius: 16px; background: #f2f3f7; align-self: flex-start; }
#deck-label.table-deck .trump-card { width: 64px; height: 92px; }
.table-deck .trump-card .durak-card-corner { font-size: 16px; top: 6px; left: 7px; }
.table-deck .trump-card .durak-card-suit { font-size: 36px; }
.game-sidebar { display: flex; flex-direction: column; min-width: 0; }
.game-sidebar h2 { font-size: 22px; }
.game-sidebar .durak-players { flex-direction: column; flex-wrap: nowrap; margin: 0; }
.game-sidebar .durak-player { width: 100%; min-width: 0; flex: 0 0 auto; }
#game-controls { margin-top: auto; text-align: right; }
#game-controls .host-controls { padding-top: 24px; }
#game-controls .durak-primary { width: 100%; min-width: 0; }
#game-controls .durak-muted { margin-bottom: 0; font-size: 11px; }
@media (max-width: 800px) {
  #room-panel { display: grid; gap: 16px; }
  .room-topline { margin-bottom: 0; }
  .durak-layout { display: contents; }
  .table-panel { order: 0; }
  .hand-panel { order: 1; margin-top: 0; }
  .game-sidebar, .invite-panel { order: 2; }
  .active-table .table-surface { min-height: 240px; }
  #deck-label.table-deck { padding: 12px; font-size: 11px; }
  #deck-label.table-deck .trump-card { width: 48px; height: 70px; }
}
