:root {
    --primary: #ff9800; /* Fő narancssárga szín */
    --primary-dark: #e65100;
    --border: #ccc;
    --bg-glass: rgba(255, 255, 255, 0.85);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 95vh;
    overflow-x: hidden;
    background: #ff9800;
}

h1 {
    text-align: center;
    margin-top: 0;
    font-size: 2.5em;
    font-weight: 900;
    text-transform: uppercase;
    background: linear-gradient(to right, #ffd700, #ffa500, #ffd700, #ffa500);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 4px 15px rgba(255, 165, 0, 0.4);
    animation: text-shine 3s linear infinite;
}

/* Glassmorphism hatás a dobozokon */
.box {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #333;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 200;
}

#lobbyScreen,
#gameScreen {
    width: 100%;
    max-width: 950px;
    display: none;
}
#menuScreen {
    display: block;
    width: 100%;
    max-width: 950px;
    text-align: center;
    margin-top: 50px;
}

input[type='text'],
input[type='number'] {
    padding: 10px;
    font-size: 1em;
    width: 80%;
    max-width: 300px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    outline: none;
    transition: border 0.3s;
}
input[type='text']:focus,
input[type='number']:focus {
    border: 1px solid #2196f3;
}

button {
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    margin: 5px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    font-weight: bold;
    /* iOS: azonnali koppintás, ne legyen 300ms késleltetés / dupla-tap zoom */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
/* A hover-effekteket csak valódi egérnél (nem érintőképernyőn) kapcsoljuk be.
   iOS-en a hover-állapot miatt kétszer kellett koppintani a gombokra (pl. VÉTÓ). */
@media (hover: hover) and (pointer: fine) {
    button:hover {
        background: #1a252f;
        transform: translateY(-2px);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    }
}
button:active {
    transform: translateY(0);
}
button:disabled {
    background: #aaa;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#playerList {
    list-style: none;
    padding: 0;
}
#playerList li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}
.admin-badge {
    color: red;
    font-size: 0.8em;
    margin-left: 10px;
}
#chatBox,
#gameChatBox {
    height: 150px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.6) !important;
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: left;
    font-family: monospace;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    text-shadow: 1px 1px 2px #000;
}
.chat-input-row {
    display: flex;
    gap: 10px;
}
.chat-input-row input {
    flex-grow: 1;
    margin: 0;
    width: auto;
}

.opponents-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.opponent {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    padding: 10px 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    opacity: 0.6;
    min-width: 100px;
}
.opponent.alive {
    opacity: 1;
}
.opponent.dead {
    filter: grayscale(100%);
    opacity: 0.3;
}
.opponent.disconnected {
    filter: grayscale(80%) opacity(0.5);
}
.opponent.active {
    background: #fff;
    transform: scale(1.1);
    border: 3px solid #ffd700;
    animation: epic-pulse 1.5s infinite;
    z-index: 10;
}
.opp-name {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1.1em;
}
.opp-cards {
    font-size: 0.9em;
    background: #eee;
    padding: 3px 8px;
    border-radius: 15px;
    display: inline-block;
}

/* "Gondolkodik..." jelző az ellenfél neve alatt */
.opponent.thinking {
    filter: grayscale(60%);
}
.opponent.thinking .opp-skin-img,
.opponent.thinking .opp-skin-placeholder {
    animation: thinking-pulse 1.2s ease-in-out infinite;
}
.opp-thinking {
    margin-top: 4px;
    font-size: 0.72em;
    font-weight: bold;
    color: #555;
    background: rgba(0, 0, 0, 0.08);
    border: 1px dashed rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    padding: 2px 6px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
@keyframes thinking-pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.45;
    }
}

/* --- SKIN SLIDER LOBBY-HOZ --- */
.skin-slider {
    display: flex;
    align-items: center;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 40px calc(50% - 50px);
    gap: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    min-height: 180px;
}
.skin-slider::-webkit-scrollbar {
    display: none;
}
.skin-item {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    transition:
        box-shadow 0.2s,
        border-color 0.2s;
    border: 4px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    background-color: #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3em;
    transform-origin: center center;
}
.skin-item.selected {
    border-color: #4caf50;
    box-shadow: 0 0 25px #4caf50;
}

.opp-skin-img {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1/1;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    margin: 0 auto 5px;
    border: 2px solid #ccc;
}
.opp-skin-placeholder {
    font-size: 2.5em;
    text-align: center;
}
.opp-arrow {
    display: flex;
    align-items: center;
    font-size: 2em;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    padding: 0 10px;
}
.admin-badge {
    color: red;
    font-size: 0.8em;
    margin-left: 10px;
}

/* --- INTRO ANIMATIONS --- */
@keyframes fly-in-left-char {
    0% {
        transform: translate(-30vw, -30vh) scale(1.5);
        opacity: 0;
    }
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
}
@keyframes fly-in-right-char {
    0% {
        transform: translate(30vw, -30vh) scale(1.5);
        opacity: 0;
    }
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
}
#introScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}
.intro-char {
    position: absolute;
    width: 300px;
    height: 300px;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(5px 5px 15px rgba(0, 0, 0, 0.5));
}
.left-char {
    animation: fly-in-left-char 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.right-char {
    animation: fly-in-right-char 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* --- EFFECTS --- */
@keyframes shake-deck {
    0% {
        transform: translate(2px, 1px) rotate(0deg);
    }
    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }
    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }
    30% {
        transform: translate(0px, 2px) rotate(0deg);
    }
    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }
    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }
    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }
    70% {
        transform: translate(2px, 1px) rotate(-1deg);
    }
    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }
    90% {
        transform: translate(2px, 2px) rotate(0deg);
    }
    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}
.effect-shuffle {
    animation: shake-deck 0.5s ease-in-out !important;
    border-color: #795548 !important;
    box-shadow: 0 0 20px #795548 !important;
}
@keyframes spin-reverse {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
        color: #9c27b0;
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}
.effect-reverse {
    display: inline-block;
    animation: spin-reverse 1s ease-in-out !important;
}
@keyframes attack-target {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(244, 67, 54, 0);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(244, 67, 54, 1);
        border-color: #f44336;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(244, 67, 54, 0);
    }
}
.effect-attack-target {
    animation: attack-target 1s ease-in-out 3 !important;
    z-index: 20;
}
@keyframes attack-source {
    0% {
        transform: translateX(0);
    }
    50% {
        transform: translateY(-20px) scale(1.1);
    }
    100% {
        transform: translateX(0);
    }
}
.effect-attack-source {
    animation: attack-source 0.5s ease-in-out !important;
    z-index: 20;
}
@keyframes steal-target {
    0% {
        filter: blur(0px);
        opacity: 1;
    }
    50% {
        filter: blur(3px);
        opacity: 0.5;
    }
    100% {
        filter: blur(0px);
        opacity: 1;
    }
}
.effect-steal-target {
    animation: steal-target 1s ease-in-out !important;
}
@keyframes steal-source {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px #607d8b;
    }
    100% {
        transform: scale(1);
    }
}
.effect-steal-source {
    animation: steal-source 1s ease-in-out !important;
    z-index: 20;
}

/* --- ÚJ CSS EFFEKTEK EMOJIK HELYETT --- */
@keyframes nope-shake-pile {
    0% {
        transform: translateX(0);
        box-shadow: 0 0 0 red;
        border-color: rgba(255, 255, 255, 0.3);
    }
    20% {
        transform: translateX(-10px) rotate(-5deg);
        box-shadow: 0 0 30px red;
        border-color: red;
    }
    40% {
        transform: translateX(10px) rotate(5deg);
    }
    60% {
        transform: translateX(-10px) rotate(-5deg);
    }
    80% {
        transform: translateX(10px) rotate(5deg);
    }
    100% {
        transform: translateX(0) rotate(0deg);
        box-shadow: 0 0 0 red;
        border-color: rgba(255, 255, 255, 0.3);
    }
}
.effect-nope-shake {
    animation: nope-shake-pile 0.6s ease-in-out !important;
    z-index: 50;
}

#playerHand {
    touch-action: pan-x;
}
@keyframes flash-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
    50% {
        box-shadow: 0 0 30px 10px rgba(33, 150, 243, 0.9);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(33, 150, 243, 0);
    }
}
.effect-flash-blue {
    animation: flash-blue 0.8s ease-out !important;
}

@keyframes mystic-glow {
    0% {
        box-shadow: inset 0 0 0 rgba(156, 39, 176, 0);
    }
    50% {
        box-shadow: inset 0 0 100px rgba(156, 39, 176, 0.8);
    }
    100% {
        box-shadow: inset 0 0 0 rgba(156, 39, 176, 0);
    }
}
.effect-mystic-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
    animation: mystic-glow 1s ease-out forwards;
}
@keyframes frame-breathe-blue {
    0% {
        box-shadow: inset 0 0 0px transparent;
    }
    50% {
        box-shadow: inset 0 0 80px rgba(33, 150, 243, 0.8);
    }
    100% {
        box-shadow: inset 0 0 0px transparent;
    }
}
.effect-blue-breathe {
    animation: frame-breathe-blue 3s ease-in-out forwards !important;
}

@keyframes brown-pulse {
    0% {
        filter: sepia(0);
    }
    50% {
        filter: sepia(1) hue-rotate(-50deg) saturate(3) brightness(0.6);
    }
    100% {
        filter: sepia(0);
    }
}
.effect-brown-pulse {
    animation: brown-pulse 1s ease-out !important;
}

@keyframes gold-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
    50% {
        box-shadow: 0 0 40px 15px rgba(255, 215, 0, 1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}
.effect-gold-flash {
    animation: gold-flash 1s ease-out !important;
}

@keyframes screen-shake-red {
    0%,
    100% {
        transform: translate(0, 0);
        box-shadow: inset 0 0 0 rgba(244, 67, 54, 0);
    }
    20% {
        transform: translate(-15px, 15px);
        box-shadow: inset 0 0 100px rgba(244, 67, 54, 0.8);
    }
    40% {
        transform: translate(15px, -15px);
    }
    60% {
        transform: translate(-15px, -15px);
    }
    80% {
        transform: translate(15px, 15px);
    }
}
.effect-nope-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    animation: screen-shake-red 0.5s ease-out forwards;
}
@keyframes pile-charge {
    0% {
        box-shadow: inset 0 -10px 10px #ffeb3b;
    }
    40% {
        box-shadow: inset 0 -150px 30px #ffeb3b;
        border-color: #ffeb3b;
    }
    70% {
        box-shadow:
            inset 0 0 50px #ff9800,
            0 0 30px #ff9800;
        border-color: #ff9800;
        background-color: rgba(255, 152, 0, 0.4);
    }
    100% {
        box-shadow: none;
        border-color: rgba(255, 255, 255, 0.5);
        background-color: rgba(255, 255, 255, 0.1);
    }
}
.effect-pile-charge {
    animation: pile-charge 1.5s ease-out !important;
}

@keyframes green-shield {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
    50% {
        box-shadow: 0 0 50px 20px rgba(76, 175, 80, 1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}
.effect-green-shield {
    animation: green-shield 1s ease-out !important;
}

@keyframes action-popup-top {
    0% {
        transform: translateX(-50%) scale(0.5);
        opacity: 0;
    }
    20% {
        transform: translateX(-50%) scale(1.1);
        opacity: 1;
    }
    80% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(-50px) scale(1);
        opacity: 0;
    }
}
.action-popup-text {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3500;
    color: white;
    font-size: 2.2em;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow:
        0 0 5px #000,
        0 0 10px #000,
        0 0 20px var(--glow-color, #fff);
    background: rgba(0, 0, 0, 0.82);
    padding: 10px 25px;
    border-radius: 12px;
    border: 2px solid var(--glow-color, #fff);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    animation-name: action-popup-top;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
    text-align: center;
    width: auto;
    min-width: 40%;
    max-width: 90%;
}
/* --- JÁTÉKOS AURA (GLOW) EFFEKTEK --- */
@keyframes purple-glow-pulse {
    0% {
        box-shadow:
            0 0 10px #9c27b0,
            inset 0 0 10px #9c27b0;
        border-color: #9c27b0;
    }
    100% {
        box-shadow:
            0 0 40px #e040fb,
            inset 0 0 30px #e040fb;
        border-color: #e040fb;
    }
}
.effect-purple-glow {
    animation: purple-glow-pulse 1s infinite alternate !important;
    border-width: 3px !important;
    z-index: 20;
}

@keyframes blue-glow-pulse {
    0% {
        box-shadow:
            0 0 10px #2196f3,
            inset 0 0 10px #2196f3;
        border-color: #2196f3;
    }
    100% {
        box-shadow:
            0 0 40px #64b5f6,
            inset 0 0 30px #64b5f6;
        border-color: #64b5f6;
    }
}
.effect-blue-glow {
    animation: blue-glow-pulse 1s infinite alternate !important;
    border-width: 3px !important;
    z-index: 20;
}

@keyframes yellow-glow-pulse {
    0% {
        box-shadow:
            0 0 10px #ffeb3b,
            inset 0 0 10px #ffeb3b;
        border-color: #ffeb3b;
    }
    100% {
        box-shadow:
            0 0 40px #fff176,
            inset 0 0 30px #fff176;
        border-color: #fff176;
    }
}
.effect-yellow-glow {
    animation: yellow-glow-pulse 1s infinite alternate !important;
    border-width: 3px !important;
    z-index: 20;
}

/* --- ÚJ GRAFIKAI EFFEKTEK --- */
.mini-shuffle-card {
    position: fixed;
    width: 20px;
    height: 30px;
    background: white;
    border: 1px solid #333;
    border-radius: 2px;
    z-index: 1000;
    pointer-events: none;
    animation: mini-fly 0.8s ease-out forwards;
    background-image: repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
    background-size: 10px 10px;
}
@keyframes mini-fly {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1.5) rotate(var(--r));
        opacity: 0;
    }
}
.reverse-center-icon {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    transform: translate(-50%, -50%);
    z-index: 2000;
    pointer-events: none;
    filter: drop-shadow(0 0 20px #9c27b0);
    animation: giant-spin 1s ease-in-out forwards;
}
@keyframes giant-spin {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(3) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(5) rotate(360deg);
        opacity: 0;
    }
}
.slash-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 6px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    box-shadow:
        0 0 15px #f00,
        0 0 30px #f00;
    z-index: 100;
    pointer-events: none;
    animation: slash-hit 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes slash-hit {
    0% {
        transform: translate(-50%, -50%) scale(3) rotate(-45deg);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1) rotate(-45deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5) rotate(-45deg);
        opacity: 0;
    }
}
@keyframes slash-hit-2 {
    0% {
        transform: translate(-50%, -50%) scale(3) rotate(45deg);
        opacity: 0;
    }
    30% {
        transform: translate(-50%, -50%) scale(1) rotate(45deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5) rotate(45deg);
        opacity: 0;
    }
}
.rain-potato {
    position: fixed;
    z-index: 2500;
    pointer-events: none;
    width: 30px;
    height: 40px;
    background-color: #8b5a2b;
    border-radius: 40% 60% 40% 50%;
    box-shadow:
        inset -3px -5px 6px rgba(0, 0, 0, 0.4),
        2px 2px 5px rgba(0, 0, 0, 0.3);
    background-image:
        radial-gradient(circle at 10px 10px, rgba(0, 0, 0, 0.2) 2px, transparent 3px),
        radial-gradient(circle at 20px 25px, rgba(0, 0, 0, 0.2) 2px, transparent 3px);
    animation: rain-drop 1.5s linear forwards;
}
@keyframes rain-drop {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(300px) rotate(360deg);
        opacity: 0;
    }
}
.flying-card {
    position: fixed;
    width: 50px;
    height: 75px;
    background: white;
    border: 2px solid #333;
    border-radius: 5px;
    z-index: 1000;
    transition: all 0.8s ease-in-out;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background-image:
        repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc),
        repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc);
    background-position:
        0 0,
        10px 10px;
    background-size: 20px 20px;
    transform: translate(-50%, -50%);
}
.disco-ball {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #ddd, #666);
    border-radius: 50%;
    box-shadow:
        0 0 15px #fff,
        0 0 30px #e040fb;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 4px, rgba(0, 0, 0, 0.3) 4px, rgba(0, 0, 0, 0.3) 5px),
        repeating-linear-gradient(90deg, transparent, transparent 4px, rgba(0, 0, 0, 0.3) 4px, rgba(0, 0, 0, 0.3) 5px);
    z-index: 60;
    pointer-events: none;
    animation: float-spin 3s linear infinite;
}
@keyframes float-spin {
    0% {
        transform: translateX(-50%) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) rotate(360deg);
    }
}
.disco-flashes {
    animation: color-flash 0.3s infinite !important;
}
@keyframes color-flash {
    0% {
        box-shadow:
            0 0 30px #f00,
            inset 0 0 20px #f00;
        border-color: #f00;
    }
    33% {
        box-shadow:
            0 0 30px #0f0,
            inset 0 0 20px #0f0;
        border-color: #0f0;
    }
    66% {
        box-shadow:
            0 0 30px #00f,
            inset 0 0 20px #00f;
        border-color: #00f;
    }
    100% {
        box-shadow:
            0 0 30px #f0f,
            inset 0 0 20px #f0f;
        border-color: #f0f;
    }
}

@keyframes text-pop-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    80% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes text-pop-in-final {
    0% {
        transform: scale(0.2);
        opacity: 0;
    }
    50% {
        transform: scale(1.4);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes start-pop-in {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    80% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}
@keyframes start-fade-out {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}
@keyframes slide-up {
    0% {
        transform: translateY(50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}
@keyframes slide-down {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}
@keyframes slide-down-header {
    0% {
        transform: translateY(-150%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}
@keyframes fade-up {
    0% {
        transform: translateY(0) translateX(-50%);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) translateX(-50%);
        opacity: 0;
    }
}
@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-30px) translateX(-50%);
    }
    60% {
        transform: translateY(-15px) translateX(-50%);
    }
}

.game-board-anim {
    animation: slide-up 1s ease-out forwards;
}
.opponents-anim {
    animation: slide-down-header 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}
.player-anim {
    animation: slide-up 1s ease-out forwards;
}

.heart-particle {
    position: fixed;
    z-index: 2500;
    pointer-events: none;
    width: 20px;
    height: 20px;
    background: #e91e63;
    transform: rotate(-45deg) scale(0.5);
    animation: float-up-heart 1s ease-in forwards;
    box-shadow: 0 0 10px #e91e63;
}
.heart-particle::before,
.heart-particle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #e91e63;
    border-radius: 50%;
}
.heart-particle::before {
    top: -10px;
    left: 0;
}
.heart-particle::after {
    left: 10px;
    top: 0;
}
@keyframes float-up-heart {
    0% {
        transform: translateY(0) rotate(-45deg) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(-45deg) scale(1.5);
        opacity: 0;
    }
}

@keyframes card-shake {
    0% {
        transform: translate(3px, 3px) rotate(0deg);
    }
    10% {
        transform: translate(-3px, -4px) rotate(-2deg);
    }
    20% {
        transform: translate(-5px, 0px) rotate(2deg);
    }
    30% {
        transform: translate(5px, 4px) rotate(0deg);
    }
    40% {
        transform: translate(3px, -3px) rotate(2deg);
    }
    50% {
        transform: translate(-3px, 4px) rotate(-2deg);
    }
    60% {
        transform: translate(-5px, 2px) rotate(0deg);
    }
    70% {
        transform: translate(5px, 2px) rotate(-2deg);
    }
    80% {
        transform: translate(-3px, -2px) rotate(2deg);
    }
    90% {
        transform: translate(3px, 4px) rotate(0deg);
    }
    100% {
        transform: translate(3px, -4px) rotate(-2deg);
    }
}

.card.shaking:not(.defuse-card) {
    animation: card-shake 0.15s infinite !important;
    border-color: #f44336 !important;
    box-shadow: 0 0 25px rgba(244, 67, 54, 0.8) !important;
    transition: none !important;
}

.kosa-img {
    position: fixed;
    width: 200px;
    z-index: 200;
    display: none;
    pointer-events: none;
    opacity: 0;
}
@keyframes kosa-br {
    0% {
        right: -30%;
        bottom: -10%;
        transform: rotate(-20deg);
        opacity: 0;
    }
    20% {
        right: 5%;
        bottom: 5%;
        transform: rotate(-10deg);
        opacity: 1;
    }
    80% {
        right: 5%;
        bottom: 5%;
        transform: rotate(-10deg);
        opacity: 1;
    }
    100% {
        right: -30%;
        bottom: -10%;
        transform: rotate(-20deg);
        opacity: 0;
    }
}
@keyframes kosa-bl {
    0% {
        left: -30%;
        bottom: -10%;
        transform: rotate(20deg);
        opacity: 0;
    }
    20% {
        left: 5%;
        bottom: 5%;
        transform: rotate(10deg);
        opacity: 1;
    }
    80% {
        left: 5%;
        bottom: 5%;
        transform: rotate(10deg);
        opacity: 1;
    }
    100% {
        left: -30%;
        bottom: -10%;
        transform: rotate(20deg);
        opacity: 0;
    }
}
@keyframes kosa-tr {
    0% {
        right: -10%;
        top: -30%;
        transform: rotate(160deg);
        opacity: 0;
    }
    20% {
        right: 10%;
        top: 5%;
        transform: rotate(170deg);
        opacity: 1;
    }
    80% {
        right: 10%;
        top: 5%;
        transform: rotate(170deg);
        opacity: 1;
    }
    100% {
        right: -10%;
        top: -30%;
        transform: rotate(160deg);
        opacity: 0;
    }
}
@keyframes kosa-tl {
    0% {
        left: -10%;
        top: -30%;
        transform: rotate(-160deg);
        opacity: 0;
    }
    20% {
        left: 10%;
        top: 5%;
        transform: rotate(-170deg);
        opacity: 1;
    }
    80% {
        left: 10%;
        top: 5%;
        transform: rotate(-170deg);
        opacity: 1;
    }
    100% {
        left: -10%;
        top: -30%;
        transform: rotate(-160deg);
        opacity: 0;
    }
}

.kosa-1-active {
    display: block !important;
    animation: kosa-br 5s infinite ease-in-out;
}
.kosa-2-active {
    display: block !important;
    animation: kosa-bl 5s infinite ease-in-out;
    animation-delay: 1.2s;
}
.kosa-3-active {
    display: block !important;
    animation: kosa-tr 5s infinite ease-in-out;
    animation-delay: 2.5s;
}
.kosa-4-active {
    display: block !important;
    animation: kosa-tl 5s infinite ease-in-out;
    animation-delay: 3.7s;
}

.pegasus-img {
    position: fixed;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    width: 220px;
}
@keyframes pegasus-flicker {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 0.8;
        transform: scale(1.1);
    }
    80% {
        opacity: 0.8;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}
.pegasus-active {
    animation: pegasus-flicker 3s infinite;
}

#bombAlert {
    display: none;
    text-align: center;
    background: rgba(244, 67, 54, 0.95);
    padding: 15px;
    border-radius: 15px;
    border: 3px solid #fff;
    box-shadow: 0 0 40px rgba(244, 67, 54, 1);
    animation: pulse-turn 0.5s infinite;
    width: 90%;
    max-width: 400px;
    box-sizing: border-box;
    position: fixed;
    top: 12%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3200;
}

/* --- PAKLIK --- */
.game-board {
    display: flex;
    justify-content: center;
    gap: 5vw;
    margin: 15px 0;
    align-items: center;
    position: relative;
    z-index: 1000;
}
.pile {
    width: 120px;
    height: 180px;
    border: 3px dashed rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    box-sizing: border-box;
}
@media (hover: hover) and (pointer: fine) {
    .pile:hover {
        border-color: #fff;
        background-color: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
    }
}
.pile#discardPile {
    border: 3px solid rgba(255, 255, 255, 0.3);
    cursor: default;
}
.pile#discardPile.drag-over {
    border-color: #4caf50;
    background-color: rgba(76, 175, 80, 0.4);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.6);
}
.pile#discardPile.bomb-drag-over {
    border-color: #f44336;
    background-color: rgba(244, 67, 54, 0.4);
    box-shadow: 0 0 30px rgba(244, 67, 54, 0.9);
}
.pile#drawPile.my-turn {
    border-color: #ffd700;
    animation: legendary-glow 2s infinite alternate;
}
.pile-title {
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}
.controls {
    text-align: center;
    margin-bottom: 15px;
}

/* --- JÁTÉKOSTÉR: SZÜRKE LÉLEGZŐ HÁTTÉR --- */
.player-area {
    background: #4a5568; /* Szürke alap */
    padding: 20px 0 0 0; /* Alul 0 padding, hogy a kártyák a doboz alján üljenek */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 12px;
    min-height: 35vh;
    border: 2px solid #2d3748;
    position: relative;
    z-index: 1000;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
}

.player-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    padding: 0 20px;
}

@keyframes breathe-orange {
    0% {
        box-shadow:
            inset 0 0 20px rgba(0, 0, 0, 0.3),
            0 0 10px rgba(255, 152, 0, 0.1);
        border-color: #2d3748;
        background-color: #4a5568;
    }
    50% {
        box-shadow:
            inset 0 0 0px rgba(0, 0, 0, 0),
            0 0 35px rgba(255, 152, 0, 0.9);
        border-color: #ff9800;
        background-color: #ff9800;
    } /* Teljes élénk narancs háttér */
    100% {
        box-shadow:
            inset 0 0 20px rgba(0, 0, 0, 0.3),
            0 0 10px rgba(255, 152, 0, 0.1);
        border-color: #2d3748;
        background-color: #4a5568;
    }
}

.player-area.active-turn {
    animation: breathe-orange 2.5s infinite ease-in-out;
    border-width: 3px;
}

/* --- KÁRTYÁK & GÖRGETHETŐ SÁV (Coverflow) --- */
.hand {
    display: flex;
    flex-grow: 1; /* Stretch vertically */
    align-items: flex-end; /* Hogy a kártyák a terület legalsó széléhez tapadjanak */
    overflow-x: auto;
    overflow-y: visible;
    padding: 70px calc(50% - 70px) 20px calc(50% - 70px); /* Bővített padding alul és felül */
    margin-bottom: 0;
    gap: -10px; /* Enyhe átfedés az alapállapotban */
    min-height: 280px;
    scroll-behavior: smooth;
    -ms-overflow-style: none; /* IE/Edge */
    scrollbar-width: none; /* Firefox */
}
.hand::-webkit-scrollbar {
    display: none;
} /* Chrome, Safari */

.card {
    width: 140px;
    height: 210px;
    border-radius: 10px;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 8px;
    box-sizing: border-box;
    cursor: grab;
    transition:
        transform 0.15s ease-out,
        border-color 0.2s,
        box-shadow 0.2s;
    position: relative;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    border: 4px solid #fff;
    background-color: #333;
    transform-origin: center bottom;
    margin: 0 5px; /* Távolság a lapok közt */
    overflow: hidden;
}
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: all 0.5s ease;
    z-index: 20;
    pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
    .card:hover::after {
        left: 200%;
        transition: all 0.7s ease;
    }
}

.card.selected {
    border-color: #2196f3;
    box-shadow: 0 0 25px #2196f3;
}

.card-title {
    font-size: 0.9em;
    font-weight: bold;
    text-align: center;
    padding-bottom: 3px;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    pointer-events: none;
}
.card-img {
    flex-grow: 1;
    background-color: #fff;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    position: relative;
    pointer-events: none;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 3000;
    backdrop-filter: blur(5px);
    animation: fade-in 0.3s forwards;
}
.modal-content-box {
    background: #2c3e50;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-sizing: border-box;
    max-width: 500px;
    box-shadow:
        0 0 30px rgba(255, 152, 0, 0.4),
        inset 0 0 20px rgba(255, 152, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.future-cards-display {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

#timerContainer {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 7px;
    overflow: hidden;
    margin-top: 8px;
    display: none;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}
#timerBar {
    width: 100%;
    height: 100%;
    background: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.9);
    border-radius: 6px;
}

@keyframes pulse-turn {
    0% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(244, 67, 54, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(244, 67, 54, 0);
    }
}

@keyframes animated-bg {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
@keyframes text-shine {
    to {
        background-position: 200% center;
    }
}
@keyframes fade-in {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}
@keyframes modal-pop {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes epic-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
        transform: scale(1.1);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
        transform: scale(1.15);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
        transform: scale(1.1);
    }
}
@keyframes legendary-glow {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    }
    100% {
        box-shadow:
            0 0 30px rgba(255, 215, 0, 1),
            inset 0 0 15px rgba(255, 215, 0, 0.5);
    }
}

/* --- IN-GAME FULLSCREEN NO-SCROLL --- */
body.in-game {
    overflow: hidden;
    margin: 0;
    padding: calc(5px + env(safe-area-inset-top)) calc(5px + env(safe-area-inset-right)) 0
        calc(5px + env(safe-area-inset-left));
    height: 100dvh;
    box-sizing: border-box;
}
body.in-game h1 {
    display: none;
}
body.in-game #introScreen {
    display: none !important;
}
/* A játéktér egy rugalmas oszlop, ami pontosan a látható magasságot tölti ki (dvh = dinamikus,
           a fel/le böngészősávokat is figyelembe veszi). Minden szekció explicit sorrendet kap, hogy
           semmi ne csússzon a tetejére. A magasságok dvh-alapúak, így mobilon nem csúszik össze. */
/* Sorrend felülről lefelé: 1) fehér állapot/kör sáv, 2) játékosok, 3) paklik, 4) vezérlők, 5) kéz.
           A gap mindenhol legalább 5px, a magasságok dvh-alapúak, így semmi nem lóg egymásba és nem kell görgetni. */
body.in-game #gameScreen {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    gap: clamp(5px, 1vh, 10px);
    overflow: hidden;
}
body.in-game .box:first-child {
    order: 1;
    flex: 0 0 auto;
    margin: 0;
    padding: clamp(6px, 1.3vh, 11px) 15px;
    z-index: 1400;
    position: relative;
    font-size: clamp(0.8em, 2.6vw, 1em);
}

body.in-game .opponents-area {
    order: 2;
    flex: 0 0 auto;
    margin: 0;
    padding: clamp(8px, 1.5vh, 14px) 10px;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.62);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    z-index: 1500;
    position: relative;
}
body.in-game .opponent {
    min-width: 0;
    flex: 1 1 0;
    padding: clamp(3px, 0.8vh, 6px) 4px;
    max-width: 100px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow:
        inset 0 0 10px rgba(255, 255, 255, 0.5),
        0 3px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(0, 0, 0, 0.1);
}
body.in-game .opponent.active {
    transform: scale(1.05);
    border-color: #ffd700;
    background: #fff;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    z-index: 10;
}
body.in-game .opp-skin-img {
    width: 100%;
    max-width: clamp(38px, 8vh, 70px);
    height: auto;
    aspect-ratio: 1/1;
    margin: 0 auto 4px;
}
body.in-game .opp-skin-placeholder {
    font-size: clamp(1em, 4vw, 2.5em);
}
body.in-game .opp-name {
    font-size: clamp(0.65em, 2.5vw, 1em);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.in-game .opp-cards {
    font-size: clamp(0.6em, 2vw, 0.85em);
    padding: 2px;
    white-space: nowrap;
}
body.in-game .opp-arrow {
    font-size: clamp(0.8em, 2vw, 1.5em);
    padding: 0 2px;
    flex-shrink: 5;
    min-width: 0;
}

body.in-game #gameChatContainer {
    order: 3;
    flex: 0 0 auto;
    margin: 0;
}
/* A VÉTÓ-vezérlő legfelülre kerül (order: 0). A negatív alsó margó kioltja a gap-et,
           amikor a gomb rejtve van, így üresen nem foglal helyet a tetején. */
body.in-game .controls {
    order: 0;
    flex: 0 0 auto;
    margin: 0 0 calc(-1 * clamp(5px, 1vh, 10px)) 0;
    min-height: 0;
}
body.in-game .game-board {
    order: 4;
    flex: 0 0 auto;
    margin: clamp(20px, 5vh, 56px) 0 clamp(36px, 9vh, 100px) 0;
    min-height: 0;
    padding: 0;
    gap: clamp(40px, 6vw, 120px);
}
/* Paklik és kártyák valódi "kártya" alak (5:7), a magasság dvh-alapú, a szélesség ebből adódik – mobilon sem keskeny. */
body.in-game .pile {
    height: clamp(104px, 16dvh, 210px);
    width: auto;
    aspect-ratio: 5 / 7;
    min-width: 74px;
}
body.in-game .player-area {
    order: 6;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0;
    margin: 0 -5px 0 -5px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}
body.in-game .player-title {
    font-size: clamp(1em, 3.2vw, 1.4em);
    margin-bottom: clamp(4px, 0.8vh, 10px);
    flex-shrink: 0;
}
body.in-game .hand {
    flex: 1 1 auto;
    min-height: 0;
    padding: clamp(24px, 4.5vh, 56px) calc(50% - 70px) 0 calc(50% - 70px);
    padding-bottom: calc(2px + env(safe-area-inset-bottom));
    margin-bottom: 0;
    align-items: flex-end;
}
body.in-game .card {
    height: clamp(150px, 23dvh, 250px);
    width: auto;
    aspect-ratio: 5 / 7;
}

/* BOMB Z-INDEX FIXES */
#bombBackground {
    z-index: 300 !important;
}
#bombVideoBackground {
    z-index: 300 !important;
}
.pegasus-img,
.kosa-img {
    z-index: 400 !important;
}
#dangerVignette {
    z-index: 500 !important;
}

/* --- MOBIL OPTIMIZÁCIÓ --- */
@media (max-width: 768px) {
    /* Képanimációk (lebegő karakterek, bombahátterek, easter egg) elrejtése és tiltása mobilon */
    #introScreen,
    .intro-char {
        display: none !important;
        animation: none !important;
    }

    body {
        padding: 10px;
    }
    h1 {
        font-size: 1.8em;
    }

    .game-board {
        flex-direction: row;
        gap: 15px;
        justify-content: center;
        margin: 10px 0;
    }
    .pile {
        width: 100px;
        height: 150px;
        font-size: 0.9em;
    }
    .pile-title {
        font-size: 0.9em;
        margin-bottom: 5px;
    }

    .hand {
        padding: 50px calc(50% - 60px) 20px calc(50% - 60px);
        min-height: 220px;
        gap: -5px;
    }
    .card {
        width: 120px;
        height: 180px;
    }

    .opp-skin-img {
        width: 100%;
        max-width: 50px;
        border-width: 1px;
        margin: 0 auto 2px;
    }
    .opp-skin-placeholder {
        font-size: 1.5em;
    }
    .opponents-area {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        padding-bottom: 10px;
    }
    .opponent {
        min-width: 50px;
        padding: 4px;
        font-size: 0.75em;
        flex-shrink: 1;
    }
    .opp-name {
        font-size: 0.9em;
        margin-bottom: 2px;
    }
    .opp-cards {
        font-size: 0.8em;
        padding: 2px 4px;
    }
    .opp-arrow {
        font-size: 1.2em;
        padding: 0 2px;
    }

    #lobbyScreen > div {
        flex-direction: column;
    }
    #lobbyChatContainer {
        border-left: none !important;
        border-top: 1px solid #ccc;
        padding-left: 0 !important;
        padding-top: 20px;
        margin-top: 20px;
        width: 100%;
        box-sizing: border-box;
    }
    .chat-input-row input {
        min-width: 0;
    }

    /* A játéktér méreteit a dvh-alapú alap szabályok kezelik (lásd feljebb body.in-game),
               így itt nem írjuk felül fix vw-értékekkel – ezért nem csúszik össze mobilon. */
    .action-popup-text {
        font-size: 1.6em;
        width: 95%;
    }

    /* Minden felugró ablak a képernyőhöz igazítva: az !important felülírja a dobozok
       fix/nagy inline szélességét (pl. a bomba width:380px-ét), a kisebb padding és a
       border-box pedig megakadályozza, hogy bármelyik modal kilógjon mobilon. */
    .modal-content-box {
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        padding: 18px !important;
        max-height: 88vh;
    }
    /* A modal hátteret kicsivel beljebb kezdjük, hogy a doboz sose érjen a kép széléhez. */
    .modal {
        padding: 10px;
        box-sizing: border-box;
    }
}

/* --- NÉZŐ MÓD JELVÉNY (kiesett játékosnak) --- */
body.spectating #gameScreen::after {
    content: '👁️ NÉZŐ MÓD';
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    z-index: 2400;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- BOMBA VISSZARAKÁS VIZUALIZÁCIÓ --- */
.bomb-viz {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    width: 150px;
    max-height: 230px;
    overflow-y: auto;
    padding: 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    -ms-overflow-style: none;
    scrollbar-width: thin;
}
.bomb-viz-cap {
    font-size: 0.72em;
    font-weight: bold;
    color: #ddd;
    text-align: center;
    padding: 2px 0;
}
.bomb-viz-more {
    font-size: 0.7em;
    color: #bbb;
    text-align: center;
    padding: 3px 0;
    font-style: italic;
}
.bomb-viz-card {
    height: 16px;
    border-radius: 4px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #5a6577, #3b4351);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
}
.bomb-viz-bomb {
    flex-shrink: 0;
    padding: 8px 4px;
    border-radius: 6px;
    margin: 3px 0;
    background: linear-gradient(135deg, #f44336, #b71c1c);
    color: #fff;
    font-weight: bold;
    font-size: 0.78em;
    text-align: center;
    border: 2px solid #fff;
    box-shadow: 0 0 14px rgba(244, 67, 54, 0.9);
    animation: bomb-viz-glow 1.1s ease-in-out infinite;
}
@keyframes bomb-viz-glow {
    0%,
    100% {
        box-shadow: 0 0 8px rgba(244, 67, 54, 0.7);
    }
    50% {
        box-shadow: 0 0 20px rgba(244, 67, 54, 1);
    }
}

/* --- DÖNTÉSI VISSZASZÁMLÁLÓ (modálok fölött) --- */
#decisionCountdown {
    display: none;
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    z-index: 3500;
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    padding: 8px 18px;
    border-radius: 22px;
    font-weight: bold;
    font-size: 1.05em;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    border: 2px solid #ffd700;
    min-width: 120px;
    text-align: center;
}
#decisionCountdown.urgent {
    border-color: #f44336;
    animation: dc-pulse 0.6s infinite;
}
@keyframes dc-pulse {
    0%,
    100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.08);
    }
}

/* Dobópakli "pop", amikor új lapot játszanak ki */
@keyframes discard-pop {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.18);
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
    }
    100% {
        transform: scale(1);
    }
}
.pile#discardPile.played-pop {
    animation: discard-pop 0.5s ease-out;
    border-color: #ffd700 !important;
}
