body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    text-align: center;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    position: relative;
}

#game-container h1 {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-top: 0;
    font-size: 2.5rem;
}

#welcome-screen {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#welcome-screen h2 {
    color: white;
    margin-top: 0;
    margin-bottom: 20px;
}

#nickname-input {
    padding: 12px;
    border: none;
    border-radius: 8px;
    width: 250px;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

#nickname-input,
#room-code-input {
    box-sizing: border-box;
    display: block;
    margin: 0 auto 12px;
}

#game-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 250px;
    margin: 0 auto 12px;
}

.game-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.2s, background-color 0.2s;
}

.game-card:hover { background: rgba(255, 255, 255, 0.16); }

.game-card.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.25);
}

.game-card-icon { font-size: 28px; line-height: 1; }

.game-card-text { display: flex; flex-direction: column; }

.game-card-text small { color: rgba(255, 255, 255, 0.7); }

#room-code-input {
    padding: 12px;
    border: none;
    border-radius: 8px;
    width: 250px;
    font-size: 16px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.lobby-btn {
    box-sizing: border-box;
    display: block;
    width: 250px;
    margin: 0 auto 12px;
    padding: 12px 30px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.lobby-btn.primary { background-color: #4CAF50; }
.lobby-btn.primary:hover { background-color: #45a049; }
.lobby-btn.secondary { background-color: #3f51b5; }
.lobby-btn.secondary:hover { background-color: #3949a3; }
.lobby-btn:disabled { opacity: 0.6; cursor: default; }

.lobby-divider {
    color: rgba(255, 255, 255, 0.6);
    margin: 4px 0 12px;
    font-size: 14px;
}

#lobby-error {
    display: none;
    margin: 12px 0 0;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(244, 67, 54, 0.85);
    color: white;
    font-size: 14px;
}

#room-bar {
    display: none;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    color: white;
}

#room-code {
    letter-spacing: 3px;
    font-size: 18px;
}

.bar-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    color: white;
    font-size: 13px;
    cursor: pointer;
}

.bar-btn:hover { background: rgba(0, 0, 0, 0.55); }
.bar-btn.danger { border-color: rgba(255, 90, 90, 0.7); }

/* Tam ekran (core/fullscreen.js), TÜM oyunlar: başlık/dolgu/kenarlık gider, alan pencerenin tamamına yayılır.
   iPhone'da (sahte mod) adres çubuğu gizlenemez; bu düzen eldeki alanı en çok açar. Parti/Kafa Topu kendi tam sayfa düzenini kullanır. */
#fullscreen-btn[hidden] { display: none; }
html.fs-active body { align-items: stretch; min-height: 100dvh; }
html.fs-active #game-container {
    box-sizing: border-box;
    width: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: max(4px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
}
html.fs-active #game-container h1 { display: none; }
html.fs-active #room-bar { gap: 6px; margin-bottom: 4px; font-size: 13px; }
/* Bomberman (mobil): normaldeki 95vw x 70vh yerine tam ekranda genişlik ve yüksekliğin tamamı (aynı esnek oran davranışı) */
@media (max-width: 850px) {
    html.fs-active #game-canvas { width: 100%; height: calc(100dvh - 110px); box-sizing: border-box; }
}
.fs-hint { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 9999; padding: 8px 12px; border-radius: 10px; background: rgba(10, 16, 35, 0.95); color: #fff; font-size: 13px; font-weight: 700; text-align: center; pointer-events: none; }

#game-canvas {
    display: none;
    image-rendering: pixelated;      /* 16 px sprite'lar keskin ölçeklensin (Bomberman) */
    border: 3px solid #2c3e50;
    background-color: #2c3e50;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#instructions {
    margin-top: 15px;
    font-size: 16px;
    color: white;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    display: inline-block;
}

#instructions p {
    margin: 5px 0;
}

#scoreboard {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 15px;
    border-radius: 10px;
    z-index: 10;
    min-width: 130px;
    text-align: left;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

#scoreboard h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    text-align: center;
    color: #4CAF50;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
}

#score-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

#score-list li {
    margin-bottom: 5px;
}

#spectator-ui {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    padding: 30px;
    border-radius: 15px;
    z-index: 20;
    border: 2px solid #555;
}

#end-title {
    color: red;
    margin-top: 0;
}

#restart-btn {
    padding: 12px 30px;
    background-color: #FF5722;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#restart-btn:hover {
    background-color: #E64A19;
}

/* --- İKİ KİŞİLİK SIRA TABANLI OYUNLAR (ortak kabuk) --- */
.duel {
    width: min(calc(100vw - 56px), 440px);
    margin: 0 auto;
    color: white;
}

.duel-title {
    margin: 0 0 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.duel-scores {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.duel-score,
.duel-draws {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid transparent;
    min-width: 0;
}

.duel-score { flex: 1; }
.duel-score.waiting { color: rgba(255, 255, 255, 0.6); font-size: 14px; text-align: center; }
.duel-score.active { border-color: #4CAF50; background: rgba(76, 175, 80, 0.3); }
.duel-score-name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-score-wins { font-size: 26px; line-height: 1.1; }
.duel-draws { text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.75); }
.duel-draws strong { font-size: 20px; color: white; }

.duel-status {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.35);
}

.duel-status.my-turn { background: #2e9e4a; animation: duel-pulse 1.4s ease-in-out infinite; }
.duel-status.their-turn { background: rgba(0, 0, 0, 0.35); color: rgba(255, 255, 255, 0.85); }
.duel-status.won { background: #d4a017; }
.duel-status.lost { background: #b23b3b; }
.duel-status.draw { background: #5a6acf; }

@keyframes duel-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(76, 175, 80, 0); }
}

.duel-board-wrap { position: relative; }
.duel-board-wrap.inactive .duel-board { opacity: 0.55; }

.duel-overlay {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(20, 20, 40, 0.88);
    z-index: 5;
}

.duel-overlay.show { display: flex; }
.duel-overlay-title { font-size: 22px; }
.duel-overlay-hint { font-size: 14px; color: rgba(255, 255, 255, 0.8); }

.duel-room-code {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 6px;
    padding: 6px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    user-select: all;
}

.duel-actions {
    display: none;
    gap: 10px;
    margin-top: 12px;
}

.duel-actions.show { display: flex; }

.duel-btn {
    flex: 1;
    min-height: 48px;
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.duel-btn.primary { background: #4CAF50; }
.duel-btn.secondary { background: #3f51b5; }
.duel-btn:disabled { opacity: 0.6; cursor: default; }

/* XOX */
.xox-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    transition: opacity 0.2s;
}

.xox-cell {
    aspect-ratio: 1;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    font-family: inherit;
    font-size: clamp(44px, 18vw, 84px);
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.15s;
    touch-action: manipulation;
}

.xox-cell:not(:disabled):hover { background: rgba(255, 255, 255, 0.28); }
.xox-cell:disabled { cursor: default; }
.xox-cell.mark-x { color: #ff6b81; }
.xox-cell.mark-o { color: #48dbfb; }
.xox-cell.last { animation: xox-pop 0.25s ease-out; }
.xox-cell.win { background: rgba(255, 215, 0, 0.35); animation: duel-win 0.9s ease-in-out infinite; }

@keyframes xox-pop {
    from { transform: scale(0.4); }
    to { transform: scale(1); }
}

@keyframes duel-win {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

/* Dörtlü Bağla */
.c4-board {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 8px;
    border-radius: 12px;
    background: #1e3a8a;
    box-shadow: inset 0 0 0 3px #162d6e;
    transition: opacity 0.2s;
}

.c4-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 2px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    min-width: 0;
}

.c4-column:not(:disabled):hover { background: rgba(255, 255, 255, 0.15); }
.c4-column:disabled { cursor: default; }

.c4-cell {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #0b1b4d;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.c4-cell.disc.red { background: radial-gradient(circle at 35% 30%, #ff7676, #d82a2a 70%); }
.c4-cell.disc.yellow { background: radial-gradient(circle at 35% 30%, #fff08a, #e6b800 70%); }
.c4-cell.drop { animation: c4-drop calc(0.12s + var(--drop-rows, 1) * 0.06s) ease-in; }
.c4-cell.win { box-shadow: 0 0 0 3px white, 0 0 14px 4px rgba(255, 255, 255, 0.8); animation: duel-win 0.9s ease-in-out infinite; }

@keyframes c4-drop {
    from { transform: translateY(calc(var(--drop-rows, 1) * -110%)); }
    to { transform: translateY(0); }
}

/* Kedi - Köpek */
.duel.duel-wide { width: min(calc(100vw - 56px), 720px); }

.cd-board {
    padding: 8px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    transition: opacity 0.2s;
}

.cd-hud {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 8px;
}

.cd-hud-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 6px 8px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    text-align: left;
}

.cd-hud-box.active { border-color: #4CAF50; background: rgba(76, 175, 80, 0.25); }
.cd-hud-box.dog { text-align: right; }
.cd-hud-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-hud-hp { font-size: 18px; line-height: 1; }
.cd-hp { height: 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.cd-hp-fill { height: 100%; width: 100%; background: #4caf50; transition: width 0.2s; }
.cd-hp-fill.mid { background: #f0ad4e; }
.cd-hp-fill.low { background: #e74c3c; }

.cd-wind {
    min-width: 84px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    text-align: center;
}

.cd-wind small { color: rgba(255, 255, 255, 0.75); font-size: 11px; }
.cd-wind-main { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 22px; line-height: 1.2; }
.cd-wind-value { font-size: 20px; }
.cd-wind-track { position: relative; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.cd-wind-bar { position: absolute; top: 0; bottom: 0; background: #7fd4ff; }

.cd-canvas {
    display: block;
    width: min(100%, calc(52vh * 1.6));   /* alçak ekranlarda sahne küçülür, kontroller görünür kalır */
    margin: 0 auto;
    height: auto;
    aspect-ratio: 8 / 5;
    border-radius: 10px;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
}

.cd-controls { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.cd-slider {
    display: grid;
    grid-template-columns: 38px 1fr 48px;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.cd-slider input[type=range] { width: 100%; height: 44px; margin: 0; accent-color: #4CAF50; touch-action: pan-y; }
.cd-slider input[type=range]::-webkit-slider-thumb { width: 28px; height: 28px; }
.cd-slider input[type=range]::-moz-range-thumb { width: 28px; height: 28px; }
.cd-slider-out { text-align: right; font-weight: 700; font-size: 18px; }

.cd-powers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.cd-power {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 54px;
    padding: 6px 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: white;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
}

.cd-power-label { font-size: 15px; font-weight: 600; }
.cd-power-note { font-size: 11px; color: rgba(255, 255, 255, 0.75); }
.cd-power.selected { border-color: #ffd400; background: rgba(255, 212, 0, 0.28); }
.cd-power.cooling { background: rgba(120, 120, 120, 0.35); color: rgba(255, 255, 255, 0.55); }
.cd-power:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cd-power:disabled { cursor: default; }
.cd-power:not(:disabled):hover { background: rgba(255, 255, 255, 0.22); }

.cd-fire {
    min-height: 58px;
    border: none;
    border-radius: 12px;
    background: #e8590c;
    color: white;
    font: inherit;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.cd-fire:disabled { background: #7a6a60; opacity: 0.7; cursor: default; }
.cd-hint { margin: 0; min-height: 18px; font-size: 13px; color: rgba(255, 255, 255, 0.8); }

@media (min-width: 700px) {
    .cd-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 16px;
        align-items: center;
    }

    .cd-controls .cd-slider { grid-column: 1; }
    .cd-controls .cd-powers { grid-column: 2; grid-row: 1 / span 2; }
    .cd-controls .cd-fire { grid-column: 1 / -1; }
    .cd-controls .cd-hint { grid-column: 1 / -1; text-align: center; }
}

/* --- Kafa Topu (gerçek zamanlı, tek ekran) --- */
body.kt-active {
    background-attachment: fixed;      /* sabit konumlu gövdede degrade tüm pencereyi kaplasın */
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

body.kt-active #game-container {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 6px 8px;
    border: 0;
    border-radius: 0;
}

body.kt-active #game-container h1 { display: none; }

body.kt-active #room-bar {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 0 0 4px;
    font-size: 13px;
}

body.kt-active #room-code { font-size: 15px; }
body.kt-active .bar-btn { padding: 4px 8px; font-size: 12px; }

body.kt-active #game-root {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

.kt-root {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    color: white;
}

.kt-setup {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

.kt-setup.hidden,
.kt-stage.hidden { display: none; }

.kt-setup-panel {
    margin: auto;
    max-width: 560px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.45);
}

.kt-title { margin: 0 0 8px; }

.kt-setup-cols { display: flex; gap: 16px; align-items: center; justify-content: center; flex-wrap: wrap; }
.kt-setup-left { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.kt-setup-right { display: flex; flex-direction: column; align-items: center; }
.kt-preview { width: 104px; height: 104px; }
.kt-file { display: none; }
.kt-hint { display: block; font-size: 13px; color: rgba(255, 255, 255, 0.8); }

.kt-emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }

.kt-emoji {
    width: 44px;
    height: 44px;
    border: 2px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}

.kt-emoji.selected { border-color: #4CAF50; background: rgba(76, 175, 80, 0.3); }

.kt-privacy { margin: 10px 0 4px; font-size: 13px; color: #ffe08a; }
.kt-face-msg { margin: 0 0 6px; min-height: 18px; font-size: 13px; }
.kt-face-msg.error { color: #ffb4b4; }

.kt-btn {
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    color: white;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
    touch-action: manipulation;
}

.kt-btn.primary { background: #4CAF50; border-color: #4CAF50; }
.kt-btn:disabled { opacity: 0.6; cursor: default; }
.kt-ready { min-width: 160px; font-size: 18px; font-weight: 700; }

.kt-camera {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 20;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.88);
}

.kt-camera.show { display: flex; }
.kt-video { max-width: 90%; max-height: 62%; border-radius: 14px; transform: scaleX(-1); background: #000; }
.kt-camera-actions { display: flex; gap: 10px; }

.kt-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kt-canvas-wrap { position: relative; }
.kt-canvas { display: block; border-radius: 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); touch-action: none; }

.kt-controls { display: none; position: absolute; inset: 0; pointer-events: none; }

@media (pointer: coarse), (hover: none) {
    .kt-controls { display: block; }
}

.kt-ctl {
    position: absolute;
    bottom: 6px;
    width: var(--kt-unit, 64px);
    height: var(--kt-unit, 64px);
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.38);
    color: white;
    font-size: calc(var(--kt-unit, 64px) * 0.42);
    line-height: 1;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.kt-ctl.down { background: rgba(255, 255, 255, 0.5); }
.kt-ctl-left { left: 6px; }
.kt-ctl-right { left: calc(6px + var(--kt-unit, 64px) + 10px); }
.kt-ctl-kick { right: 6px; }
.kt-ctl-jump { right: calc(6px + var(--kt-unit, 64px) + 10px); }

.kt-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 5;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(10, 16, 36, 0.7);
}

.kt-overlay.show { display: flex; }

.kt-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 92%;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.55);
    text-align: center;
}

.kt-card-title { font-size: 24px; }
.kt-score-line { font-size: 20px; font-weight: 700; }
.kt-session { font-size: 14px; color: rgba(255, 255, 255, 0.85); }

.kt-room-code {
    padding: 4px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 6px;
    user-select: all;
}

.kt-toast {
    display: none;
    position: absolute;
    top: 58px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(229, 72, 77, 0.9);
    font-size: 13px;
    white-space: nowrap;
}

.kt-toast.show { display: block; }

.kt-rotate {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 50;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 20, 45, 0.97);
    text-align: center;
    font-size: 20px;
}

.kt-rotate-icon { font-size: 64px; animation: kt-turn 1.8s ease-in-out infinite; }

@keyframes kt-turn {
    0%, 30% { transform: rotate(0deg); }
    70%, 100% { transform: rotate(90deg); }
}

@media (orientation: portrait) and (max-width: 700px) {
    .kt-root.in-stage .kt-rotate { display: flex; }
}

@media (max-height: 520px) {
    .kt-title { display: none; }
    .kt-setup-panel { padding: 8px 12px; }
    .kt-preview { width: 72px; height: 72px; }
    .kt-emoji { width: 38px; height: 38px; font-size: 20px; }
    .kt-btn { min-height: 40px; padding: 6px 10px; font-size: 14px; }
    .kt-privacy { margin: 6px 0 2px; }
    .kt-card-title { font-size: 20px; }
    .kt-room-code { font-size: 26px; }
}

/* --- MOBİL KONTROLLER --- */
#mobile-controls {
    display: none; /* Oyun başlayana kadar gizli */
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    justify-content: space-between;
    flex-direction: row-reverse; /* Bomba Sola, Joystick Sağa! */
    padding: 0 30px;
    box-sizing: border-box;
    pointer-events: none; /* Ana ekran tıklamalarını engellememesi için */
    z-index: 50;
}

.control-btn {
    border-radius: 50%;
    color: white;
    pointer-events: auto; /* Butonlar tıklanabilir kalsın */
    touch-action: manipulation;
    user-select: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid rgba(255, 255, 255, 0.4);
}

/* --- YENİ ÇEKMELİ JOYSTICK TASARIMI --- */
#joystick-zone {
    width: 130px;
    height: 130px;
    position: relative;
    touch-action: none; 
    pointer-events: auto; /* Joystick alanı dokunulabilir olsun */
}

#joystick-base {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    position: absolute;
    box-sizing: border-box;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3), 0 4px 10px rgba(0,0,0,0.3);
}

#joystick-knob {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    pointer-events: none; 
    transition: transform 0.05s ease-out; 
}

/* Dokunmatik Bomba Butonu */
.action-btn {
    width: 80px;
    height: 80px;
    font-size: 36px;
    background: rgba(255, 50, 50, 0.4);
    border-color: rgba(255, 50, 50, 0.7);
    margin-bottom: 25px;
}

@media (max-width: 850px) {
    #game-container {
        padding: 15px;
        margin: 10px;
    }
    
    #game-container h1 {
        font-size: 2rem;
    }
    
    #game-canvas {
        width: 95vw;
        height: 70vh;
    }
    
    #welcome-screen {
        width: 80%;
        padding: 20px;
    }
    
    #nickname-input,
    #room-code-input,
    #game-cards,
    .lobby-btn {
        width: 100%;
    }
    
    #instructions {
        display: none; /* Mobilde klavye talimatını gizle */
    }
}
/* --- Parti (tahta oyunu, tek ekran) --- */
body.parti-active {
    background-attachment: fixed;
    display: block;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

body.parti-active #game-container {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 6px 8px;
    border: 0;
    border-radius: 0;
}

body.parti-active #game-container h1 { display: none; }
body.parti-active #room-bar { flex: 0 0 auto; flex-wrap: nowrap; gap: 6px; margin: 0 0 4px; font-size: 13px; }
body.parti-active #room-code { font-size: 15px; }
body.parti-active .bar-btn { padding: 4px 8px; font-size: 12px; }
body.parti-active #game-root { flex: 1 1 auto; min-height: 0; display: flex; }

.pt-root { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; color: #fff; }
.pt-root .hidden { display: none !important; }

.pt-btn {
    border: 0;
    border-radius: 10px;
    padding: 9px 12px;
    min-height: 40px;
    font-size: 15px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
}
.pt-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pt-btn.primary { background: #ffb400; color: #2b1d00; }
.pt-btn.danger { background: #e5484d; }
.pt-btn.big { min-height: 52px; font-size: 18px; }
.pt-btn.small { min-height: 32px; padding: 4px 9px; font-size: 13px; }
.pt-hint { display: block; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.pt-warn { color: #ffd24a; }
.pt-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.pt-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); font-size: 12px; font-weight: 700; }
.pt-label { font-size: 13px; font-weight: 700; margin: 6px 0 2px; display: block; }
.pt-row .pt-label { margin: 0 6px 0 0; }
.pt-select { padding: 4px; border-radius: 8px; border: 0; font-size: 13px; }

/* lobi */
.pt-lobby { flex: 1; min-height: 0; overflow-y: auto; touch-action: pan-y; display: flex; justify-content: center; }
.pt-lobby-panel {
    margin: auto;
    width: min(100%, 560px);
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
}
.pt-title { margin: 0; }
.pt-seats { display: flex; flex-direction: column; gap: 6px; }
.pt-seat { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.1); border: 2px solid transparent; }
.pt-seat-av { font-size: 26px; }
.pt-seat-name { flex: 1; text-align: left; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; }
.pt-av { font-size: 24px; padding: 4px; }
.pt-av.selected { outline: 3px solid #ffb400; }
.pt-settings { display: flex; flex-direction: column; gap: 6px; }

/* oyun */
.pt-game { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.pt-bar { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.4); font-size: 14px; font-weight: 700; }
.pt-bar-mid.mine { color: #ffd24a; }
.pt-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.pt-boardcol { flex: 0 0 auto; min-height: 0; display: flex; flex-direction: column; gap: 3px; }
.pt-board { flex: 0 0 auto; width: 100%; aspect-ratio: 10 / 7; display: flex; align-items: center; justify-content: center; }
.pt-strip { flex: 0 0 auto; min-height: 34px; padding: 2px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.35); font-size: 13px; line-height: 1.25; }
.pt-strip-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-strip-line:last-child { font-weight: 700; }
.pt-canvas { border-radius: 12px; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); touch-action: manipulation; }
.pt-side { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.pt-players { display: flex; flex-direction: column; gap: 4px; }
.pt-teams { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.pt-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 4px; }
.pt-pcard { position: relative; padding: 3px 5px; border-radius: 9px; background: rgba(0, 0, 0, 0.4); border: 2px solid transparent; min-width: 0; }
.pt-pcard.current { background: rgba(255, 180, 0, 0.35); }
.pt-pcard.me { box-shadow: inset 0 0 0 2px #ffd24a; }
.pt-ptop { display: flex; align-items: center; gap: 4px; }
.pt-pav { font-size: 18px; }
.pt-pname { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-hp { height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.5); overflow: hidden; margin: 2px 0; }
.pt-hp i { display: block; height: 100%; }
.pt-pstats { display: flex; justify-content: space-between; font-size: 11px; gap: 4px; }
.pt-items { letter-spacing: 1px; }
.pt-pstatus { position: absolute; top: 1px; right: 3px; font-size: 11px; }
.pt-controls { display: flex; flex-direction: column; gap: 6px; align-items: stretch; text-align: center; min-height: 54px; }
.pt-controls .pt-btn.big { width: 100%; }

.pt-logbtn { padding: 2px 8px; min-height: 30px; }
/* Tam ekran (core/fullscreen.js): iPhone'da sahte mod adres çubuğu payını dinamik viewport ile alır; çentik/güvenli alan dolguları */
html.fs-fake body.parti-active { height: 100dvh; min-height: 100dvh; }
html.fs-active body.parti-active #game-container {
    padding-top: max(6px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
}
.pt-log { position: absolute; right: 8px; top: 44px; bottom: 80px; width: min(300px, 80%); overflow-y: auto; z-index: 4; padding: 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.8); font-size: 13px; touch-action: pan-y; }
.pt-logline { padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }

.pt-overlay { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; pointer-events: none; padding: 8px; }
.pt-overlay > * { pointer-events: auto; }
.pt-card { display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; max-width: min(92%, 420px); padding: 14px 18px; border-radius: 14px; background: rgba(10, 16, 35, 0.92); box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6); }
.pt-card-small { padding: 8px 12px; font-size: 14px; font-weight: 700; align-self: center; }
.pt-overlay .pt-card-small { position: relative; }
.pt-card-title { font-size: 20px; }
.pt-rank { margin: 0; padding: 0; list-style: none; text-align: left; font-size: 16px; font-weight: 700; display: flex; flex-direction: column; gap: 4px; }
.pt-wheel { font-size: 64px; }
.pt-wheel.spinning { animation: pt-spin 0.9s linear infinite; }
@keyframes pt-spin { to { transform: rotate(360deg); } }

/* Düello minioyunu: oyun kartın içinde; rövanş/lobiye dön düğmeleri yok (sonucu Parti uygular) */
.pt-duel-card { width: min(96%, 480px); max-width: 480px; max-height: 100%; overflow-y: auto; padding: 8px; }
.pt-duel-root { width: 100%; position: relative; }
/* Sonuç/atış sınırı şeridi: oyun alanını kapatmaz (üstte ince bant); tahta kilitlenir ama görünür kalır */
.pt-duel-strip { position: absolute; top: 0; left: 0; right: 0; z-index: 5; padding: 6px 10px; text-align: center; font-weight: 800; font-size: 15px; color: #fff; background: rgba(10, 16, 35, 0.92); border-radius: 12px 12px 0 0; pointer-events: none; }
.pt-duel-locked .duel-board-wrap { pointer-events: none; }
.pt-duel-root .duel { width: 100%; }
.pt-duel-root .duel-actions,
.pt-duel-root .duel-actions.show { display: none; }
.pt-duel-root .duel-title { font-size: 18px; margin: 0 0 4px; }
/* Nişan (aim): kalıcı düğüm, üstte; yalnız atan çubuğa dokunabilir (pointer-events), diğerleri/sonuç/yumruk şovu hiçbir şeyi engellemez */
.pt-aim { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); z-index: 60; width: min(94vw, 460px); padding: 10px 12px; border-radius: 14px;
    background: rgba(20, 24, 40, 0.94); color: #fff; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45); pointer-events: none; touch-action: none; user-select: none; -webkit-user-select: none; }
.pt-aim.hidden { display: none; }
.pt-aim.pt-aim-mine { pointer-events: auto; }
.pt-aim.pt-aim-show { background: rgba(60, 20, 20, 0.9); }
.pt-aim-title { font-size: 14px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.pt-aim-row { display: flex; align-items: center; gap: 8px; }
.pt-aim-att { font-size: 26px; flex: none; }
.pt-aim-track { position: relative; flex: 1; height: 54px; border-radius: 10px; background: rgba(255, 255, 255, 0.14); overflow: hidden; touch-action: none; }
.pt-aim-track.pt-aim-wait { opacity: 0.55; }
.pt-aim-zone { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; }
.pt-aim-b3 { position: absolute; inset: 0; background: rgba(255, 210, 74, 0.35); display: flex; align-items: center; justify-content: center; }
.pt-aim-b2 { height: 100%; background: rgba(255, 150, 40, 0.5); display: flex; align-items: center; justify-content: center; }
.pt-aim-b1 { height: 100%; background: rgba(255, 70, 70, 0.65); }
.pt-aim-tgt { position: absolute; font-size: 28px; line-height: 1; pointer-events: none; }
.pt-aim-ind { position: absolute; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.9); border-radius: 2px; }
.pt-aim-drop { margin-top: 8px; padding: 12px 0; text-align: center; font-size: 22px; font-weight: 800; letter-spacing: 1px; border-radius: 12px; background: rgba(255, 255, 255, 0.2); min-height: 22px; }
.pt-aim-mine .pt-aim-drop { background: #e8453c; }
.pt-aim-res { margin-top: 6px; text-align: center; font-size: 20px; font-weight: 800; min-height: 0; }

/* Düşen Zemin (ffa) */
.pt-dz { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.pt-dz-hud { display: flex; justify-content: space-between; width: 100%; max-width: 380px; font-size: 14px; font-weight: 700; color: #fff; }
.pt-dz-canvas { display: block; width: 100%; max-width: 380px; height: auto; aspect-ratio: 1 / 1; border-radius: 8px; background: #12162a; touch-action: none; }
.pt-dz-pad { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 380px; gap: 12px; touch-action: none; user-select: none; -webkit-user-select: none; }
.pt-dz-joy { position: relative; flex: none; width: 132px; height: 132px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); border: 2px solid rgba(255, 255, 255, 0.3); touch-action: none; user-select: none; -webkit-user-select: none; }
.pt-dz-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); pointer-events: none; }
.pt-dz-actions { display: flex; flex-direction: column; gap: 10px; }
.pt-dz-btn { min-width: 116px; height: 60px; border: 0; border-radius: 14px; font-size: 18px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, 0.25); touch-action: none; user-select: none; -webkit-user-select: none; }
.pt-dz-btn:active { background: rgba(255, 255, 255, 0.5); }
.pt-dz-btn:disabled { opacity: 0.45; }

/* Kurbağa (ffa) */
.pt-frog { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.pt-frog-hud { display: flex; justify-content: space-between; width: 100%; max-width: 360px; font-size: 14px; font-weight: 700; color: #fff; }
.pt-frog-canvas { display: block; width: 100%; max-width: 360px; height: auto; aspect-ratio: 9 / 10; border-radius: 8px; background: #41454d; touch-action: none; }
.pt-frog-pad { display: grid; grid-template-columns: repeat(3, 68px); grid-template-areas: ". up ." "left down right"; gap: 6px; margin-top: 2px; }
.pt-frog-btn { height: 56px; border: 0; border-radius: 12px; font-size: 24px; color: #fff; background: rgba(255, 255, 255, 0.22); touch-action: none; user-select: none; -webkit-user-select: none; }
.pt-frog-btn:active { background: rgba(255, 255, 255, 0.45); }
.pt-frog-up { grid-area: up; }
.pt-frog-left { grid-area: left; }
.pt-frog-down { grid-area: down; }
.pt-frog-right { grid-area: right; }
.pt-frog-bar { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; white-space: nowrap; }
.pt-duel-pairs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; }
.pt-duel-pair { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); }
.pt-duel-pair.done { background: rgba(76, 175, 80, 0.22); }
.pt-watch { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.pt-watch-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.pt-watch-who { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.pt-watch-who.turn { background: rgba(255, 212, 0, 0.28); }
.pt-watch-who.win { background: rgba(76, 175, 80, 0.45); }
.pt-watch-canvas { display: block; width: 100%; max-width: 360px; align-self: center; border-radius: 8px; background: #6ec6ff; }
.pt-watch-grid { display: grid; gap: 3px; align-self: center; width: 100%; }
.pt-watch-grid.cols3 { grid-template-columns: repeat(3, 1fr); max-width: 150px; }
.pt-watch-grid.cols7 { grid-template-columns: repeat(7, 1fr); max-width: 210px; }
.pt-watch-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(255, 255, 255, 0.1); font-size: 18px; font-weight: 800; line-height: 1; }
.pt-watch-connect4 .pt-watch-cell { font-size: 30px; }
.pt-watch-cell.p0 { color: #ff6b6b; }
.pt-watch-cell.p1 { color: #ffd24a; }
.pt-watch-bars { display: flex; flex-direction: column; gap: 4px; }
.pt-watch-bar { position: relative; height: 14px; border-radius: 7px; background: rgba(0, 0, 0, 0.45); overflow: hidden; }
.pt-watch-fill { display: block; height: 100%; background: #4caf50; }
.pt-watch-fill.mid { background: #f0ad4e; }
.pt-watch-fill.low { background: #e74c3c; }
.pt-watch-bar small { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.pt-watch-info { font-size: 13px; }
.pt-watch-info.dim { color: rgba(255, 255, 255, 0.7); font-size: 12px; }
.pt-watch-result { font-weight: 800; font-size: 14px; }
.pt-duel-names { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.pt-duel-spectator { display: flex; flex-direction: column; gap: 6px; align-items: center; padding: 14px 18px; }
.pt-duel-spectator strong { font-size: 20px; }
@media (max-width: 480px) {
    .pt-duel-card { padding: 4px; }
    .pt-duel-root .duel-scores { gap: 4px; }
}

@media (orientation: landscape) and (min-width: 760px) {
    .pt-main { flex-direction: row; }
    .pt-boardcol { flex: 1 1 auto; max-height: none; height: 100%; min-width: 0; }
    .pt-board { flex: 1 1 auto; width: auto; aspect-ratio: auto; max-height: none; min-height: 0; min-width: 0; }
    .pt-side { flex: 0 0 min(300px, 34%); }
    .pt-pgrid { grid-template-columns: repeat(2, 1fr); }
    .pt-pname { font-size: 13px; }
}
@media (max-height: 520px) {
    .pt-btn { min-height: 34px; padding: 5px 8px; font-size: 13px; }
    .pt-btn.big { min-height: 40px; font-size: 15px; }
}

.pt-turns { display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.pt-turns-label { margin-right: 4px; }
.pt-turns-arrow { opacity: 0.6; }
.pt-turn { font-size: 18px; padding: 1px 4px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); }
.pt-turn.now { background: #ffb400; box-shadow: 0 0 0 2px #ffd24a; }
.pt-turn.done { opacity: 0.45; }

.pt-afk { border: 2px solid #ffb400; }
.pt-afk .pt-btn { width: 100%; }

.pt-emotes { display: flex; gap: 6px; justify-content: center; }
.pt-emote { font-size: 20px; min-width: 44px; min-height: 40px; padding: 2px 8px; }

/* yardım / lejant */
.pt-legendbtn { padding: 2px 8px; min-height: 30px; }
.pt-legend { display: none; }
.pt-legend.open {
    display: block;
    position: fixed;
    inset: 52px 8px 8px;
    z-index: 14;
    overflow-y: auto;
    touch-action: pan-y;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(10, 16, 35, 0.96);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    font-size: 13px;
}
.pt-legend-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.pt-legend-title { margin: 8px 0 3px; font-weight: 800; color: #ffd24a; }
.pt-legend-row { display: flex; gap: 8px; align-items: flex-start; padding: 2px 0; }
.pt-legend-icon { flex: 0 0 26px; text-align: center; font-size: 18px; }
.pt-legend-text { flex: 1; line-height: 1.3; }
@media (orientation: landscape) and (min-width: 760px) {
    .pt-legendbtn, .pt-legend-close { display: none; }
    .pt-legend, .pt-legend.open { display: block; position: static; inset: auto; z-index: auto; max-height: 38vh; overflow-y: auto; padding: 6px 8px; border-radius: 10px; background: rgba(0, 0, 0, 0.32); box-shadow: none; font-size: 12px; }
}
.pt-legend { text-align: left; }
.pt-legend-title { text-align: left; }

/* kompakt oyuncu kartları */
.pt-pgrid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.pt-pcard { cursor: pointer; padding: 2px 4px; }
.pt-ptop { display: flex; align-items: center; gap: 3px; }
.pt-pav { font-size: 18px; line-height: 1; }
.pt-pstar { font-size: 12px; font-weight: 800; white-space: nowrap; }
.pt-pstatus { margin-left: auto; font-size: 10px; line-height: 1; white-space: nowrap; }
.pt-pname { font-size: 11px; line-height: 1.15; font-weight: 700; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.pt-pcard.open { outline: 2px solid #ffd24a; }
.pt-pdetail { padding: 6px 8px; border-radius: 9px; background: rgba(0, 0, 0, 0.45); font-size: 12px; line-height: 1.4; text-align: left; }
.pt-until { font-weight: 800; color: #ffd24a; }
