/* ==========================================================================
   Bilardo — masa, isteka ve falso arayüzü
   ========================================================================== */

.bilardo-home-page,
.bilardo-game-page {
    background-color: var(--color-bg);
    background-image:
        radial-gradient(900px 520px at 10% -10%, rgba(16, 185, 129, 0.16), transparent 60%),
        radial-gradient(900px 520px at 94% 0%, rgba(34, 211, 238, 0.10), transparent 60%),
        radial-gradient(700px 500px at 50% 110%, rgba(124, 92, 252, 0.10), transparent 60%),
        linear-gradient(180deg, rgba(11, 16, 32, 0.75), rgba(11, 16, 32, 0.96));
    background-attachment: fixed;
}

/* --------------------------------------------------------------------------
   Ana sayfa
   -------------------------------------------------------------------------- */
.bilardo-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 5px 12px;
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.10);
    color: #6ee7b7;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.bilardo-kicker::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.9);
}

.bilardo-setup {
    gap: 20px;
}

.bilardo-mode-description {
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border-left: 2px solid rgba(16, 185, 129, 0.5);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    background: rgba(16, 185, 129, 0.06);
    color: var(--color-text-secondary);
    font-size: 0.86rem;
    line-height: 1.55;
}

#target-row.is-single {
    display: none;
}

.bilardo-panel-hint {
    margin: 0;
    padding: 12px 14px;
    border: 1px dashed rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.45);
    color: var(--color-text-secondary);
    font-size: 0.86rem;
    line-height: 1.6;
}

.cue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.cue-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: linear-gradient(160deg, rgba(28, 38, 59, 0.72), rgba(15, 23, 42, 0.55));
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.18s var(--ease), box-shadow 0.18s ease;
}

.cue-card:hover {
    transform: translateY(-2px);
    border-color: rgba(148, 163, 184, 0.36);
}

.cue-card.selected {
    border-color: var(--cue-accent, #22d3ee);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--cue-accent, #22d3ee) 45%, transparent),
        0 16px 32px -24px var(--cue-accent, #22d3ee);
    background: linear-gradient(160deg, color-mix(in srgb, var(--cue-color, #334155) 28%, transparent), rgba(15, 23, 42, 0.72));
}

.cue-card-top {
    display: flex;
    align-items: center;
    gap: 9px;
}

.cue-card-stick {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e8f6ff 0 12%, var(--cue-accent, #f2c14e) 12% 22%, var(--cue-color, #b7793f) 22% 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: rotate(-12deg);
}

.cue-card-stick::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 1px;
    width: 5px;
    height: 4px;
    border-radius: 999px;
    background: #67e8f9;
    box-shadow: 0 0 8px rgba(103, 232, 249, 0.9);
}

.cue-card-name {
    overflow: hidden;
    font-size: 0.88rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cue-card-sub {
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cue-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.cue-stats span {
    display: grid;
    grid-template-columns: 44px 1fr;
    align-items: center;
    gap: 6px;
}

.cue-stats em {
    color: var(--color-text-muted);
    font-size: 0.64rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cue-stats i {
    position: relative;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.cue-stats i::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--v, 0.5) * 100%);
    border-radius: inherit;
    background: linear-gradient(90deg, #34d399, var(--cue-accent, #22d3ee));
}

.bilardo-status {
    min-height: 20px;
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

.bilardo-status.is-error { color: #f87171; }
.bilardo-status.is-success { color: #4ade80; }
.bilardo-status.is-info { color: #67e8f9; }

/* Oyuncu adı inputu — diğer oyunlarla aynı stil */
.name-input {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--color-text);
    font-family: var(--font-ui);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.name-input:focus {
    outline: none;
    border-color: rgba(124, 92, 252, 0.6);
    background: rgba(124, 92, 252, 0.05);
    box-shadow: 0 0 0 3px rgba(124, 92, 252, 0.14);
}

.name-input::placeholder {
    color: #64748b;
}

.bilardo-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 26px;
}

.bilardo-feature {
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(11, 16, 32, 0.48);
}

.bilardo-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.12);
    font-size: 1.1rem;
}

.bilardo-feature h2 {
    margin-bottom: 5px;
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 700;
}

.bilardo-feature p {
    color: var(--color-text-secondary);
    font-size: 0.84rem;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Oyun ekranı
   -------------------------------------------------------------------------- */
.bilardo-game-page {
    padding: calc(var(--nav-height) + 16px) 14px 36px;
}

.bilardo-shell {
    width: min(1420px, 100%);
    margin: 0 auto;
}

.bilardo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(14px);
}

.bilardo-topbar-left,
.bilardo-topbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    min-width: 0;
}

.bilardo-topbar .game-back {
    position: static;
    margin: 0;
    padding: 6px 10px;
    font-size: 0.78rem;
}

.bilardo-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid rgba(16, 185, 129, 0.28);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.10);
    color: #6ee7b7;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.bilardo-mode-badge.alt {
    border-color: rgba(34, 211, 238, 0.26);
    background: rgba(34, 211, 238, 0.09);
    color: #7dd3fc;
}

.bilardo-topbar .room-code {
    margin: 0;
    padding: 5px 10px;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
}

.connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.65);
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.connection-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

.connection-pill.is-online i {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.9);
}

.connection-pill.is-offline i {
    background: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

/* Skorboard */
.scoreboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.66);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.player-card.is-active {
    border-color: rgba(52, 211, 153, 0.55);
    background: rgba(16, 185, 129, 0.09);
    box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.18), 0 14px 30px -24px rgba(16, 185, 129, 0.7);
}

.player-card.is-winner {
    border-color: rgba(250, 204, 21, 0.6);
    background: rgba(250, 204, 21, 0.08);
}

.player-turn-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.3);
}

.player-card.is-active .player-turn-dot {
    background: #34d399;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.95);
    animation: turnPulse 1.8s ease-in-out infinite;
}

@keyframes turnPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.65; }
}

.player-card-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.player-card-main strong {
    overflow: hidden;
    color: var(--color-text);
    font-size: 0.92rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-card-main span {
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-score {
    margin-left: auto;
    color: #f8fafc;
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
}

.player-card.is-active .player-score {
    color: #6ee7b7;
}

.scoreboard-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 150px;
    padding: 6px 12px;
    text-align: center;
}

.scoreboard-kicker {
    color: var(--color-text-muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.scoreboard-center strong {
    color: var(--color-text);
    font-size: 0.85rem;
    font-weight: 700;
}

#break-label {
    color: var(--color-text-muted);
    font-size: 0.66rem;
}

/* Masa yerleşimi */
.table-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 292px;
    gap: 14px;
    align-items: start;
}

.table-column {
    min-width: 0;
}

.canvas-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 264 / 144;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(600px 260px at 50% 0%, rgba(34, 211, 238, 0.07), transparent 70%),
        #070c17;
    box-shadow: 0 30px 70px -34px rgba(2, 6, 23, 0.95);
    touch-action: none;
}

#table-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.canvas-wrap.is-placing #table-canvas {
    cursor: grab;
}

.canvas-wrap.is-charging #table-canvas {
    cursor: grabbing;
}

.canvas-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(4, 9, 20, 0.72);
    backdrop-filter: blur(5px);
}

.canvas-overlay.hidden {
    display: none;
}

.overlay-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 330px;
    padding: 22px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(15, 23, 42, 0.9);
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.overlay-card h2 {
    color: var(--color-text);
    font-size: 1.2rem;
    font-weight: 700;
}

.overlay-card p {
    color: var(--color-text-secondary);
    font-size: 0.84rem;
    line-height: 1.55;
}

.overlay-code {
    margin-top: 4px;
    padding: 7px 16px;
    border: 1px dashed rgba(34, 211, 238, 0.4);
    border-radius: var(--radius-xs);
    background: rgba(34, 211, 238, 0.08);
    color: #67e8f9;
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.24em;
}

.overlay-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid rgba(148, 163, 184, 0.22);
    border-top-color: #34d399;
    border-radius: 50%;
    animation: bilardoSpin 0.9s linear infinite;
}

@keyframes bilardoSpin {
    to { transform: rotate(360deg); }
}

.shot-toast {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 5;
    max-width: min(92%, 520px);
    padding: 9px 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 999px;
    background: rgba(8, 15, 30, 0.92);
    color: var(--color-text);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.shot-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.shot-toast.is-foul {
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.shot-toast.is-success {
    border-color: rgba(52, 211, 153, 0.45);
    color: #6ee7b7;
}

/* Kontroller */
.shot-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.66);
}

.power-control {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.control-label {
    color: var(--color-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.power-track {
    position: relative;
    flex: 1;
    height: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.65);
}

.power-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #34d399, #facc15 58%, #f97316 80%, #ef4444);
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.35);
    transition: width 0.04s linear;
}

.power-value {
    min-width: 38px;
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: right;
}

.shoot-btn {
    width: auto;
    min-height: 44px;
    padding: 10px 20px;
    border: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #8d72ff, var(--color-accent));
    color: #fff;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    user-select: none;
    touch-action: none;
    box-shadow:
        0 14px 28px -16px rgba(124, 92, 252, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: transform 0.18s var(--ease), box-shadow 0.18s ease, background 0.18s ease;
}

.shoot-btn:not(:disabled):hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #9b84ff, var(--color-accent-strong));
    box-shadow:
        0 18px 34px -16px rgba(124, 92, 252, 1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.shoot-btn:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: 0 8px 16px -12px rgba(124, 92, 252, 0.8);
}

.shoot-btn.is-charging {
    background: linear-gradient(135deg, #fbbf24, #f97316);
    box-shadow: 0 0 26px -4px rgba(249, 115, 22, 0.7);
    color: #1a1206;
}

.table-hint {
    margin: 8px 2px 0;
    color: var(--color-text-muted);
    font-size: 0.76rem;
    line-height: 1.5;
    text-align: center;
}

/* Yan panel */
.bilardo-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.side-card {
    padding: 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: rgba(15, 23, 42, 0.66);
}

.side-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.side-card h2 {
    color: var(--color-text);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.mini-btn {
    padding: 3px 7px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: 0.62rem;
    font-weight: 600;
    cursor: pointer;
}

.mini-btn:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

/* Falso widget */
.spin-widget {
    display: flex;
    justify-content: center;
    padding: 2px 0 8px;
    touch-action: none;
}

.spin-ball {
    position: relative;
    width: 148px;
    height: 148px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 33% 27%, #ffffff 0%, #f1f5f9 36%, #cbd5e1 68%, #94a3b8 100%);
    box-shadow:
        inset -12px -14px 28px rgba(15, 23, 42, 0.28),
        inset 8px 9px 20px rgba(255, 255, 255, 0.9),
        0 16px 30px -18px rgba(2, 6, 23, 0.9);
    cursor: crosshair;
    touch-action: none;
}

.spin-axis-h,
.spin-axis-v {
    position: absolute;
    top: 50%;
    left: 50%;
    background: rgba(71, 85, 105, 0.28);
    pointer-events: none;
}

.spin-axis-h {
    width: 82%;
    height: 1px;
    transform: translate(-50%, -50%);
}

.spin-axis-v {
    width: 1px;
    height: 82%;
    transform: translate(-50%, -50%);
}

.spin-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f87171, #dc2626 60%, #7f1d1d);
    box-shadow: 0 3px 9px rgba(127, 29, 29, 0.55);
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.04s linear;
}

.spin-readout {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--color-text-muted);
    font-size: 0.66rem;
}

.spin-readout b {
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.spin-hint {
    margin-top: 6px;
    color: var(--color-text-muted);
    font-size: 0.66rem;
    line-height: 1.45;
    text-align: center;
}

/* İsteka kartı */
.cue-chip {
    padding: 3px 8px;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.08);
    color: #7dd3fc;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
}

.cue-preview {
    position: relative;
    height: 16px;
    margin: 4px 0 10px;
}

.cue-preview span {
    position: absolute;
    left: 0;
    right: 0;
    top: 6px;
    height: 5px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e8f6ff 0 9%, #67e8f9 9% 16%, #d9b06b 16% 26%, var(--cue-color, #b7793f) 26% 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transform: rotate(-2deg);
}

.cue-name {
    display: block;
    margin-bottom: 7px;
    color: var(--color-text);
    font-size: 0.86rem;
    font-weight: 700;
}

.cue-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cue-stats span {
    display: grid;
    grid-template-columns: 48px 1fr;
    align-items: center;
    gap: 7px;
}

.cue-stats em {
    color: var(--color-text-muted);
    font-size: 0.62rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cue-stats i {
    position: relative;
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.cue-stats i::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--v, 0.5) * 100%);
    border-radius: inherit;
    background: linear-gradient(90deg, #34d399, #22d3ee);
}

/* Ayar ve geçmiş */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: var(--color-text-secondary);
    font-size: 0.76rem;
    cursor: pointer;
}

.toggle-row input {
    width: 15px;
    height: 15px;
    accent-color: #34d399;
}

/* Temel buton — diğer oyunlarla uyumlu gradient stili */
.game-btn,
.primary {
    width: 100%;
    min-height: 50px;
    padding: 13px 22px;
    border: 0;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #8d72ff, var(--color-accent));
    color: #fff;
    font-family: var(--font-ui);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        0 14px 28px -16px rgba(124, 92, 252, 0.95),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: transform 0.18s var(--ease), box-shadow 0.18s ease, background 0.18s ease;
}

.game-btn:not(:disabled):hover,
.primary:not(:disabled):hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #9b84ff, var(--color-accent-strong));
    box-shadow:
        0 18px 34px -16px rgba(124, 92, 252, 1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.game-btn:not(:disabled):active,
.primary:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: 0 8px 16px -12px rgba(124, 92, 252, 0.8);
}

.game-btn:disabled,
.primary:disabled {
    background: #2b354a;
    color: var(--color-text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

/* Ghost / secondary butonlar — kurallar, falsosuz, kopyala vb. */
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--color-text-secondary);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.ghost-btn:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
    background: rgba(148, 163, 184, 0.06);
}

.ghost-btn:active {
    background: rgba(148, 163, 184, 0.12);
}

.ghost-btn.small {
    padding: 4px 10px;
    font-size: 0.72rem;
    gap: 5px;
}

.ghost-btn.wide {
    width: 100%;
    margin-top: 7px;
    justify-content: center;
}

.shot-history {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.shot-history li {
    padding: 7px 9px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 7px;
    background: rgba(2, 6, 23, 0.35);
    color: var(--color-text-secondary);
    font-size: 0.7rem;
    line-height: 1.4;
}

.shot-history li.is-foul {
    border-color: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
}

.shot-history li strong {
    color: var(--color-text);
}

.shot-history .history-empty {
    border: 0;
    background: transparent;
    color: var(--color-text-muted);
    text-align: center;
}

.emote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.emote-grid button {
    padding: 7px 6px;
    border: 1px solid var(--color-border);
    border-radius: 7px;
    background: rgba(2, 6, 23, 0.35);
    color: var(--color-text-secondary);
    font-size: 0.68rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.emote-grid button:hover {
    border-color: rgba(34, 211, 238, 0.35);
    color: #7dd3fc;
}

.emote-log {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    max-height: 84px;
    overflow-y: auto;
    font-size: 0.68rem;
    color: var(--color-text-muted);
}

.emote-log span strong {
    color: #7dd3fc;
}

/* Modallar */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 7, 18, 0.76);
    backdrop-filter: blur(7px);
}

.modal-overlay.hidden {
    display: none;
}

.bilardo-modal {
    width: min(520px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    padding: 28px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-xl);
    background:
        radial-gradient(400px 220px at 50% 0%, rgba(16, 185, 129, 0.12), transparent 70%),
        #111827;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.bilardo-modal.help-modal {
    width: min(760px, 100%);
    text-align: left;
}

.modal-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: #6ee7b7;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.bilardo-modal h2 {
    color: var(--color-text);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.bilardo-modal > p {
    margin-top: 8px;
    color: var(--color-text-secondary);
    font-size: 0.88rem;
}

.game-over-score {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 18px 0;
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
}

.game-over-score span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--color-text);
}

.game-over-score small {
    color: var(--color-text-muted);
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-top: 18px;
}

.modal-actions .ghost-btn,
.modal-actions .primary {
    width: auto;
    min-width: 130px;
}

.help-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 16px;
}

.help-grid h3 {
    margin-bottom: 4px;
    color: var(--color-text);
    font-size: 0.86rem;
    font-weight: 700;
}

.help-grid p {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
    line-height: 1.55;
}

.help-grid kbd {
    padding: 1px 5px;
    border: 1px solid var(--color-border-strong);
    border-radius: 4px;
    background: rgba(2, 6, 23, 0.6);
    color: var(--color-text);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

/* Toast */
.toast-container {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(330px, calc(100vw - 36px));
    pointer-events: none;
}

.bilardo-toast {
    padding: 10px 13px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.95);
    color: var(--color-text);
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.25s var(--ease);
}

.bilardo-toast.is-error { border-color: rgba(239, 68, 68, 0.5); color: #fca5a5; }
.bilardo-toast.is-success { border-color: rgba(52, 211, 153, 0.5); color: #6ee7b7; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 1080px) {
    .table-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .bilardo-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-card,
    .emote-card {
        min-width: 0;
    }
}

@media (max-width: 720px) {
    .bilardo-game-page {
        padding: calc(var(--nav-height) + 10px) 8px 28px;
    }

    .bilardo-topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .scoreboard {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .scoreboard-center {
        grid-column: 1 / -1;
        grid-row: 2;
        min-width: 0;
        padding: 2px 0 0;
    }

    .player-card {
        padding: 9px 10px;
    }

    .player-score {
        font-size: 1.3rem;
    }

    .bilardo-side {
        grid-template-columns: 1fr;
    }

    .shot-controls {
        flex-wrap: wrap;
    }

    .power-control {
        flex-basis: 100%;
    }

    .shoot-btn {
        flex: 1;
    }

    .help-grid {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .ghost-btn,
    .modal-actions .primary {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .cue-grid {
        grid-template-columns: 1fr;
    }

    .bilardo-feature-grid {
        grid-template-columns: 1fr;
    }

    .bilardo-topbar-left {
        gap: 6px;
    }

    .connection-pill span {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
