:root { --durak-ink: #f6f2df; --durak-gold: #f2d15f; --durak-dark: #101a36; --durak-blue: #233d71; --durak-card-width: clamp(61px, 10vw, 88px); }
body[data-durak-room] { --game-ui-accent: var(--durak-gold); --game-ui-header-background: #101a36f2; --game-ui-primary-background: var(--durak-gold); --game-ui-primary-color: #18213c; }
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { min-height: 100vh; min-height: 100dvh; margin: 0; overflow: hidden; color: var(--durak-ink); font-family: Arial, Helvetica, sans-serif; background: radial-gradient(circle at 50% 28%, #49699e 0, #263c6c 43%, #101a36 100%); }
button, input { font: inherit; } button { cursor: pointer; } button:disabled { cursor: default; }
.durak-header { min-height: calc(62px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 16px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid #ffffff24; background: #101a36e8; backdrop-filter: blur(10px); }
.durak-back, .durak-brand { color: var(--durak-ink); text-decoration: none; } .durak-back { display: flex; align-items: center; width: max-content; font-size: .8rem; } .durak-back svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; } .durak-brand { font: 800 clamp(1.35rem, 4vw, 1.8rem) Georgia, serif; letter-spacing: -.05em; } .durak-brand::first-letter { color: var(--durak-gold); }
.durak-info { justify-self: end; width: 29px; height: 29px; border: 1px solid #d9e1ff; border-radius: 50%; color: var(--durak-ink); background: transparent; }
#durak-app { height: calc(100dvh - 62px - env(safe-area-inset-top, 0px)); overflow: auto; }
.durak-panel { width: min(460px, calc(100% - 28px)); margin: clamp(25px, 7vh, 75px) auto; padding: 26px; text-align: center; border: 1px solid #ffffff2b; border-radius: 22px; background: #101a36e8; box-shadow: 0 24px 60px #070b1c99; }
.durak-logo { height: 92px; display: flex; align-items: center; justify-content: center; } .durak-logo img { width: 59px; transform: rotate(-9deg); filter: drop-shadow(0 8px 12px #0008); } .durak-logo strong { margin-left: -7px; padding: 8px 13px; border-radius: 8px; background: #b43b43; font: 800 clamp(1.7rem, 8vw, 2.55rem) Georgia, serif; letter-spacing: -.07em; }
.durak-panel h1 { margin: 8px 0; } .durak-panel p { color: #cbd5f3; } .durak-form { display: grid; gap: 14px; margin-top: 22px; text-align: left; } .durak-form label { display: grid; gap: 6px; font-weight: 700; } .durak-form input { width: 100%; padding: 12px; border: 1px solid #ffffff44; border-radius: 10px; background: #ffffff12; color: inherit; }
.durak-primary, .durak-secondary, .durak-danger, .durak-link { padding: 11px 16px; border: 0; border-radius: 10px; font-weight: 800; } .durak-primary { background: var(--durak-gold); color: #18213c; } .durak-secondary { background: #ffffff1c; color: var(--durak-ink); } .durak-danger { background: #bb4747; color: #fff; } .durak-link { display: block; margin: 14px auto 0; color: #ccd9ff; background: transparent; text-decoration: underline; }
.durak-player-list { padding: 0; list-style: none; } .durak-player-list li { display: flex; justify-content: space-between; padding: 10px; border-bottom: 1px solid #ffffff1c; } .durak-player-list small { color: var(--durak-gold); }
.durak-recent { margin: 24px auto; width: min(650px, calc(100% - 28px)); } .durak-recent h2 { font-size: 1rem; } .durak-recent-session { display: flex; justify-content: space-between; gap: 10px; margin: 9px 0; padding: 12px; border-radius: 12px; background: #101a36cc; } .durak-recent-session strong, .durak-recent-session small { display: block; } .durak-recent-session small { color: #cbd5f3; margin: 4px 0; } .durak-recent-session button { margin: 2px; border: 0; border-radius: 6px; padding: 5px 8px; background: #ffffff21; color: inherit; }
.durak-board { width: min(1050px, 100%); min-height: 100%; margin: auto; padding: 12px clamp(10px, 2vw, 24px) 24px; display: grid; grid-template-rows: auto auto 1fr auto auto; gap: 10px; }
.durak-players { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; } .durak-player { position: relative; min-width: 122px; padding: 7px 10px; border: 1px solid #ffffff28; border-radius: 10px; background: #101a3699; text-align: center; } .durak-player.active { border-color: var(--durak-gold); box-shadow: 0 0 16px #f2d15f66; } .durak-player strong, .durak-player small { display: block; } .durak-player small { color: #cbd5f3; font-size: .74rem; } .durak-mini-hand { height: 20px; overflow: hidden; white-space: nowrap; } .durak-mini-hand img { width: 15px; margin-left: -9px; transform: rotate(calc((var(--card-order) - 3) * 5deg)); }
.durak-info-row { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 5vw, 52px); } .durak-deck, .durak-discard, .durak-trump { display: grid; justify-items: center; font-size: .78rem; color: #d8e3ff; } .durak-deck img { width: 52px; } .durak-trump { grid-template-columns: auto 1fr; gap: 5px; align-items: center; } .durak-trump .durak-card { width: 38px; }
.durak-card { position: relative; width: var(--durak-card-width); aspect-ratio: 533 / 764; padding: 0; border: 0; border-radius: 5px; background: none; box-shadow: 0 5px 10px #0006; } .durak-card img { display: block; width: 100%; height: 100%; border-radius: inherit; } .durak-card.rejected { animation: durak-card-rejected .52s ease-in-out; transform-origin: 50% 85%; } .durak-card:disabled { opacity: 1; }
.durak-table { min-height: 175px; padding: 12px; align-self: stretch; border: 1px solid #ffffff24; border-radius: 18px; background: #18335ab8; text-align: center; } .durak-table > p { margin: 0 0 8px; font-weight: 700; } .durak-table > small { color: #d5e1ff; } .durak-empty-table { padding: 36px; color: #c3d0ed; } .durak-table-pairs { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 22px; } .durak-pair { position: relative; width: calc(var(--durak-card-width) * 1.35); height: calc(var(--durak-card-width) * 1.43); } .durak-pair .durak-card { position: absolute; left: 0; top: 0; } .durak-pair .table-defense { left: 34%; top: 12%; transform: rotate(8deg); } .durak-open-defense { /* position: absolute; left: 38%; top: 18%; display: grid; place-items: center; width: 54%; aspect-ratio: 533 / 764; border: 2px dashed #d4e0ff88; border-radius: 5px; font-size: 1.7rem; color: #d4e0ff; */ }
.durak-actions { min-height: 42px; text-align: center; } .durak-actions button { margin: 0 4px; }
.durak-self { border-top: 1px solid #ffffff30; text-align: center; } .durak-self .durak-player { display: inline-block; margin: 5px; } .durak-own-hand { display: flex; justify-content: center; align-items: end; min-height: calc(var(--durak-card-width) * 1.43); padding: 13px 0 0; overflow-x: auto; } .durak-own-hand .durak-card { margin-left: clamp(-30px, -3vw, -11px); flex: 0 0 auto; } .durak-own-hand .durak-card:first-child { margin-left: 0; }
#durak-status { position: fixed; z-index: 120; left: 50%; bottom: 20px; max-width: calc(100% - 30px); padding: 10px 15px; border-radius: 10px; background: #101a36ee; color: #fff; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .2s; } #durak-status.visible { opacity: 1; transform: translate(-50%, 0); }
#durak-reaction-controls { position: fixed; z-index: 100; right: 15px; bottom: 16px; } .durak-reaction-toggle, .durak-reactions button { border: 0; border-radius: 50%; background: #ffffffdd; font-size: 1.25rem; } .durak-reaction-toggle { width: 44px; height: 44px; } .durak-reactions { position: absolute; right: 0; bottom: 52px; display: grid; grid-template-columns: repeat(4, 36px); gap: 4px; padding: 6px; border-radius: 12px; background: #101a36ee; } .durak-reactions button { width: 36px; height: 36px; }
#durak-rules[hidden] { display: none; } #durak-rules { position: fixed; z-index: 130; inset: 0; display: grid; place-items: center; padding: 20px; background: #070c1a9c; } .durak-rules-dialog { position: relative; max-width: 520px; padding: 25px; border-radius: 16px; background: #f7f1df; color: #18213c; } .durak-rules-dialog button { position: absolute; top: 7px; right: 10px; border: 0; background: none; font-size: 1.6rem; } .durak-rules-dialog li { margin: 9px 0; }
.durak-fullscreen { position: fixed; right: 15px; top: 73px; width: 34px; height: 34px; border: 0; border-radius: 8px; color: #fff; background: #101a36aa; } .durak-fullscreen svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@keyframes durak-card-rejected { 0%, 100% { transform: rotate(0); } 18% { transform: rotate(-5deg); } 36% { transform: rotate(5deg); } 54% { transform: rotate(-4deg); } 72% { transform: rotate(4deg); } 88% { transform: rotate(-2deg); } }
@media (max-width: 560px) { .durak-board { padding-inline: 8px; } .durak-info-row { gap: 14px; } .durak-table { min-height: 144px; } .durak-player { min-width: 105px; } }

/* Durak uses the same table-oriented layout as the other card games. */
:root { --durak-card-height: calc(var(--durak-card-width) * 1.4334); }
.durak-board { min-height: 100%; padding: 10px max(10px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); display: grid; grid-template-rows: minmax(100px, auto) minmax(240px, 1fr) auto minmax(146px, auto); gap: 5px; }
.durak-players { min-width: 0; display: flex; align-items: flex-start; justify-content: center; flex-wrap: wrap; gap: clamp(6px, 2vw, 18px); }
.durak-player { position: relative; min-width: 0; padding: 5px 8px 7px; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: center; }
.durak-player.active { border-color: #f2d15f8c; background: #f2d15f0b; box-shadow: 0 0 20px #f2d15f14; }
.durak-player header { display: flex; align-items: center; justify-content: center; gap: 10px; } .durak-player header strong, .durak-player-name { max-width: 145px; overflow: hidden; color: var(--durak-ink); font-size: .8rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.durak-player-name { padding: 0; border: 0; background: transparent; cursor: pointer; } .durak-name-wrap { position: relative; } .durak-player-meta { display: inline-flex; align-items: center; gap: 3px; color: var(--durak-muted); white-space: nowrap; } .durak-player-meta small { color: var(--durak-muted); font-size: .62rem; }
.durak-role { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font-size: .83rem; line-height: 1; } .durak-role.attack { background: #b54747; } .durak-role.defend { background: #386c9b; }
.durak-opponent-hand { height: var(--durak-card-height); margin-top: 4px; display: flex; justify-content: center; } .durak-opponent-hand img { width: var(--durak-card-width); height: auto; margin-left: clamp(-52px, -5vw, -27px); border-radius: 8px; } .durak-opponent-hand img:first-child { margin-left: 0; }
.durak-table { position: relative; min-height: 240px; padding: 29px 8px 31px; display: grid; place-content: center; justify-items: center; border: 0; border-radius: 0; background: transparent; } .durak-turn { position: absolute; top: 5px; left: 50%; width: min(420px, calc(100% - 30px)); margin: 0; color: var(--durak-gold); font-size: .8rem; font-weight: 800; text-align: center; transform: translateX(-50%); }
.durak-piles { position: absolute; z-index: 2; top: 31px; right: max(5px, env(safe-area-inset-right, 0px)); display: flex; align-items: flex-start; gap: 6px; } .durak-pile { position: relative; width: calc(var(--durak-card-width) + 9px); min-height: calc(var(--durak-card-height) + 9px); } .durak-trump .durak-card { width: var(--durak-card-width); } .durak-empty-pile { display: block; width: var(--durak-card-width); height: var(--durak-card-height); border: 1px dashed #ffffff35; border-radius: 8px; }
.durak-physical-stack { position: relative; display: block; width: calc(var(--durak-card-width) + var(--stack-offset)); height: calc(var(--durak-card-height) + var(--stack-offset)); isolation: isolate; } .durak-stack-card { position: absolute; top: var(--card-offset); left: var(--card-offset); width: var(--durak-card-width); height: auto; aspect-ratio: 533 / 764; border-radius: 8px; object-fit: cover; pointer-events: none; }
.durak-table-pairs { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 22px; } .durak-pair { width: calc(var(--durak-card-width) * 1.38); height: var(--durak-card-height); } .durak-pair .durak-card { width: var(--durak-card-width); } .durak-empty-table { color: var(--durak-muted); } .durak-attack-limit { position: absolute; bottom: 6px; left: 50%; color: var(--durak-muted); font-size: .7rem; transform: translateX(-50%); } .durak-round-message { position: absolute; z-index: 3; bottom: 21px; left: 50%; width: min(440px, calc(100% - 30px)); min-height: 1em; margin: 0; color: var(--durak-ink); font-size: .76rem; font-weight: 700; text-align: center; transform: translateX(-50%); }
.durak-actions { min-height: 38px; text-align: center; } .durak-self { position: relative; width: 100%; padding-top: 2px; border-top: 0; text-align: center; } .durak-self .durak-player { display: block; margin: 0; } .durak-self .durak-player header { justify-content: space-between; padding: 0 4px; } .durak-own-hand { min-height: var(--durak-card-height); padding-top: 8px; } .durak-own-hand .durak-card { width: var(--durak-card-width); }
.durak-reaction-bubble { position: absolute; z-index: 80; top: calc(100% + 6px); left: 50%; min-width: 38px; max-width: min(280px, calc(100vw - 30px)); padding: 7px 10px; border-radius: 14px; background: #fff; color: #18213c; font-size: 1.3rem; line-height: 1; box-shadow: 0 5px 18px #0007; transform: translateX(-50%); } .durak-reaction-bubble.own { top: auto; bottom: calc(100% + 7px); left: 0; transform: none; } .durak-reaction-bubble.message { width: max-content; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.25; text-align: left; }
#durak-reaction-controls { position: static; } .durak-reaction-picker { position: fixed; z-index: 1500; left: 50%; bottom: max(48px, calc(env(safe-area-inset-bottom, 0px) + 42px)); display: grid; grid-template-columns: repeat(7, 34px); gap: 3px; padding: 7px; border: 1px solid #ffffff38; border-radius: 13px; background: #101a36f5; box-shadow: 0 8px 28px #0009; transform: translateX(-50%); } .durak-reaction-picker button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 1.12rem; } .durak-reaction-picker button:hover, .durak-reaction-picker button:focus-visible { background: #ffffff20; }
.durak-fullscreen { position: fixed; z-index: 120; right: max(3px, env(safe-area-inset-right, 0px)); top: auto; bottom: max(3px, env(safe-area-inset-bottom, 0px)); width: 38px; height: 38px; padding: 8px; border: 0; border-radius: 0; background: #101a3699; color: var(--durak-muted); } .durak-fullscreen svg { width: 100%; height: 100%; }
.durak-card-arrival-hidden { visibility: hidden; } .durak-discard-flight { position: fixed; z-index: 1600; display: block; pointer-events: none; perspective: 900px; transform-origin: top left; } .durak-discard-flight > span { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; } .durak-discard-flight img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 8px; backface-visibility: hidden; } .durak-discard-flight .back { transform: rotateY(180deg); }
.durak-take-flight { position: fixed; z-index: 1600; display: block; pointer-events: none; perspective: 900px; transform-origin: top left; } .durak-take-flight > span { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; } .durak-take-flight img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 8px; backface-visibility: hidden; } .durak-take-flight .back { transform: rotateY(180deg); }
.durak-draw-flight { position: fixed; z-index: 1600; display: block; pointer-events: none; perspective: 900px; transform-origin: top left; } .durak-draw-flight > span { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; } .durak-draw-flight img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 8px; backface-visibility: hidden; } .durak-draw-flight .back { transform: rotateY(180deg); }
.durak-play-flight { position: fixed; z-index: 1600; display: block; pointer-events: none; perspective: 900px; transform-origin: top left; } .durak-play-flight > span { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; } .durak-play-flight img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 8px; backface-visibility: hidden; } .durak-play-flight .back { transform: rotateY(180deg); }
html, body, #durak-app { overflow-x: hidden; }
.durak-piles { position: static; display: block; transform: none; } .durak-pile { position: absolute; top: 31px; display: block; } .durak-deck { left: max(5px, env(safe-area-inset-left, 0px)); } .durak-trump { left: calc(var(--durak-card-width) + 14px); } .durak-discard { right: max(14px, env(safe-area-inset-right, 0px)); }
.durak-deck .durak-stack-card { top: 0; left: 0; width: var(--durak-card-width); transform: translate(calc(var(--card-offset) * -.7px), calc(var(--card-offset) * -.7px)); }
.durak-discard .durak-stack-card { top: 0; left: 0; transform: translate(calc(var(--card-offset) * -1px), calc(var(--card-offset) * -1px)); }
.durak-own-hand { overflow-x: auto; overflow-y: hidden; }
.durak-card.unplayable { filter: brightness(0.5); }
.durak-deck { z-index: 1; } .durak-trump { top: -10px; left: max(18px, calc(env(safe-area-inset-left, 0px) + 14px)); z-index: 0; } .durak-trump .durak-card { transform: rotate(8deg); }
.durak-reaction-picker { display: flex; grid-template-columns: none; } .durak-reaction-picker > div { display: grid; grid-template-columns: repeat(7, 34px); gap: 3px; } .durak-reaction-picker .keyboard { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 1.12rem; } .durak-reaction-composer { position: fixed; z-index: 1500; left: 50%; bottom: max(48px, calc(env(safe-area-inset-bottom, 0px) + 42px)); width: min(360px, calc(100vw - 24px)); padding: 7px; display: flex; gap: 6px; border: 1px solid #ffffff38; border-radius: 13px; background: #101a36f5; box-shadow: 0 8px 28px #0009; transform: translateX(-50%); } .durak-reaction-composer input { min-width: 0; flex: 1; padding: 9px 10px; border: 1px solid #ffffff38; border-radius: 10px; background: #101a36; color: var(--durak-ink); } .durak-reaction-composer button { padding: 9px 11px; border: 0; border-radius: 9px; background: var(--durak-gold); color: #18213c; font-weight: 800; }
@media (max-width: 720px) { .durak-table { min-height: 220px; } }
@media (max-width: 560px) { .durak-board { grid-template-rows: minmax(82px, auto) minmax(200px, 1fr) auto minmax(130px, auto); } .durak-players { gap: 2px 7px; } .durak-opponent-hand img { margin-left: clamp(-52px, -8vw, -27px); } .durak-player header { gap: 4px; } .durak-player header strong, .durak-player-name { max-width: 95px; } .durak-pile { top: 27px; } .durak-trump { top: 45px; left: max(16px, calc(env(safe-area-inset-left, 0px) + 12px)); } .durak-table { padding-top: 26px; } .durak-round-message { bottom: 19px; } .durak-reaction-picker > div { grid-template-columns: repeat(5, 34px); } }
