/* ==================== CSS VARIABLES ==================== */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-tertiary: #1a1a3a;
    --bg-card: rgba(30, 30, 60, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    --red: #dc2626;
    --red-glow: rgba(220, 38, 38, 0.5);
    --green: #16a34a;
    --green-glow: rgba(22, 163, 74, 0.5);
    --gold: #fbbf24;
    --gold-glow: rgba(251, 191, 36, 0.5);

    --accent: #dc2626;
    --accent-light: #ef4444;
    --accent-glow: rgba(220, 38, 38, 0.4);

    --success: #00d26a;
    --warning: #ffc048;
    --error: #ff4757;

    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px var(--accent-glow);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at top, rgba(220, 38, 38, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(22, 163, 74, 0.1) 0%, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==================== HOME BUTTON ==================== */
.home-button {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    z-index: 1000;
}

.home-button:hover {
    background: var(--accent);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.home-button svg {
    width: 24px;
    height: 24px;
}

/* ==================== SCREENS ==================== */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* ==================== MENU ==================== */
.menu-container {
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.logo {
    margin-bottom: 40px;
}

.logo-icon {
    font-size: 5rem;
    margin-bottom: 16px;
    animation: dartFloat 3s ease-in-out infinite;
}

@keyframes dartFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--red), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(220, 38, 38, 0.3);
}

/* Player Info */
.player-info {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.player-info input {
    flex: 1;
    padding: 14px 18px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.player-info input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--gold);
    font-weight: 600;
}

/* Menu Buttons */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon {
    font-size: 1.3rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--green), #22c55e);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px var(--green-glow);
}

.btn-tertiary {
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-tertiary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
}

.btn-back {
    background: transparent;
    color: var(--text-secondary);
    padding: 12px;
}

.btn-back:hover {
    color: var(--text-primary);
}

.btn-copy {
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 12px 20px;
    font-size: 0.95rem;
}

.btn-copy:hover {
    background: var(--accent);
}

/* ==================== MODAL CONTAINER ==================== */
.modal-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    max-width: 450px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-container h2 {
    font-size: 1.6rem;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-container input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 20px;
    transition: var(--transition);
}

.modal-container input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Game Mode Buttons */
.game-mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.game-mode-btn {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    color: var(--text-primary);
}

.game-mode-btn:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.mode-icon {
    font-size: 2rem;
    margin-right: 16px;
    min-width: 50px;
    text-align: center;
}

.mode-details {
    display: flex;
    flex-direction: column;
}

.mode-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.mode-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Difficulty Buttons */
.difficulty-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.difficulty-btn {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    color: var(--text-primary);
}

.difficulty-btn:hover {
    border-color: var(--accent);
    background: var(--bg-tertiary);
}

.difficulty-icon {
    font-size: 2rem;
    margin-right: 16px;
}

.difficulty-name {
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
}

.difficulty-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.difficulty-btn.easy:hover {
    border-color: var(--success);
}

.difficulty-btn.medium:hover {
    border-color: var(--warning);
}

.difficulty-btn.hard:hover {
    border-color: var(--error);
}

/* Waiting Screen */
.modal-container.waiting {
    padding: 50px 40px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-glass);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.room-code {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--accent-light);
    background: var(--bg-glass);
    padding: 16px 24px;
    border-radius: var(--border-radius-sm);
    margin: 20px 0;
    font-family: monospace;
}

.queue-position {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ==================== GAME SCREEN ==================== */
.game-container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    width: 100%;
    height: 100%;
    max-height: 800px;
    padding: 20px;
    gap: 16px;
}

/* Players Bar */
.players-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

.player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.player.active {
    background: var(--bg-glass);
    box-shadow: var(--shadow-sm);
}

.player-dart {
    font-size: 2rem;
}

.player-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.player-name {
    font-weight: 600;
    font-size: 1rem;
}

.player-score {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
}

.turn-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-glass);
    transition: var(--transition);
}

.turn-indicator.active {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.game-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.game-mode-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
}

.darts-remaining {
    display: flex;
    gap: 8px;
}

.darts-remaining .dart {
    font-size: 1.5rem;
    transition: var(--transition);
}

.darts-remaining .dart.used {
    opacity: 0.2;
    transform: scale(0.8);
}

/* ==================== GAME AREA ==================== */
.game-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

/* Dartboard Container */
.dartboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 20px;
}

.current-throw {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.throw-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.throw-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
}

.dartboard-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
}

#dartboard {
    width: 100%;
    height: 100%;
    cursor: crosshair;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}

.throw-indicator {
    position: absolute;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    z-index: 50;
}

.throw-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #c0c0c0;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 15px var(--gold);
}

.throw-indicator::after {
    content: '🎯';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.throw-indicator.visible {
    opacity: 1;
    animation: dartPlant 0.2s ease-out forwards;
}

@keyframes dartPlant {
    0% {
        transform: translate(-50%, -50%) scale(2);
    }

    50% {
        transform: translate(-50%, -50%) scale(0.8);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.last-throws {
    display: flex;
    gap: 16px;
    margin-top: 16px;
}

.throw-item {
    padding: 8px 16px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.throw-item.triple {
    color: var(--gold);
    background: rgba(251, 191, 36, 0.2);
}

.throw-item.double {
    color: var(--green);
    background: rgba(22, 163, 74, 0.2);
}

.throw-item.bullseye {
    color: var(--red);
    background: rgba(220, 38, 38, 0.2);
}

/* ==================== DARTBOARD SVG STYLES ==================== */
#dartboard .segment {
    transition: filter 0.2s, transform 0.1s;
    transform-origin: center;
}

#dartboard .segment:hover {
    filter: brightness(1.3);
}

#dartboard .segment-black {
    fill: #1a1a2e;
}

#dartboard .segment-cream {
    fill: #f5f0dc;
}

#dartboard .segment-red {
    fill: #c41e3a;
}

#dartboard .segment-green {
    fill: #228b22;
}

#dartboard .wire {
    fill: none;
    stroke: #888;
    stroke-width: 1;
}

#dartboard .number {
    fill: white;
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

#dartboard .bullseye-outer {
    fill: #228b22;
}

#dartboard .bullseye-inner {
    fill: #c41e3a;
}

/* ==================== SIDE PANEL ==================== */
.side-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    padding: 14px 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.tab-btn:hover:not(.active) {
    color: var(--text-secondary);
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

.tab-content.active {
    display: flex;
}

/* Stats Tab */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-sm);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
}

/* Cricket Board */
.cricket-board {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cricket-board h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.cricket-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 4px;
    font-size: 0.9rem;
}

.cricket-row {
    display: contents;
}

.cricket-cell {
    padding: 8px;
    text-align: center;
    background: var(--bg-glass);
    border-radius: var(--border-radius-sm);
}

.cricket-cell.target {
    font-weight: 600;
    background: var(--bg-tertiary);
}

.cricket-cell.closed {
    color: var(--success);
}

.cricket-mark {
    color: var(--red);
}

/* Chat Tab */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-glass);
    max-width: 90%;
}

.chat-message.player-0 {
    align-self: flex-start;
    border-left: 3px solid var(--red);
}

.chat-message.player-1 {
    align-self: flex-end;
    border-right: 3px solid var(--green);
}

.chat-message.system {
    align-self: center;
    background: transparent;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.chat-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.chat-text {
    font-size: 0.95rem;
    word-break: break-word;
}

.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input-container input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}

.chat-input-container input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-send {
    padding: 10px 16px;
    background: var(--accent);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.btn-send:hover {
    background: var(--accent-light);
}

/* History Tab */
.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    background: var(--bg-glass);
}

.history-round {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 60px;
}

.history-player {
    font-weight: 600;
    min-width: 80px;
}

.history-throws {
    display: flex;
    gap: 8px;
    flex: 1;
}

.history-throws span {
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.85rem;
}

.history-total {
    font-weight: 700;
    color: var(--gold);
}

/* ==================== GAME OVER MODAL ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content.game-over .result-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.modal-content.game-over h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.modal-content.game-over p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 20px;
}

.final-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-glass);
    border-radius: var(--border-radius-sm);
}

.final-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.final-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.rating-change {
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.rating-change.positive {
    color: var(--success);
}

.rating-change.negative {
    color: var(--error);
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rematch-status {
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==================== 3D THROWING OVERLAY ==================== */
.throwing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.9) 100%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    cursor: crosshair;
    overflow: hidden;
}

.throwing-overlay.active {
    display: flex;
}

.throwing-view {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Aiming Crosshair */
.aiming-crosshair {
    position: absolute;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 110;
    transition: transform 0.05s ease-out;
}

.crosshair-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--red), 0 0 20px var(--red-glow);
}

.crosshair-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: crosshairPulse 1.5s ease-in-out infinite;
}

.crosshair-ring::before,
.crosshair-ring::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
}

.crosshair-ring::before {
    top: 50%;
    left: -15px;
    width: 12px;
    height: 2px;
    transform: translateY(-50%);
}

.crosshair-ring::after {
    top: -15px;
    left: 50%;
    width: 2px;
    height: 12px;
    transform: translateX(-50%);
}

@keyframes crosshairPulse {

    0%,
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Crosshair Wobble Animation */
.aiming-crosshair.wobbling {
    animation: wobble 0.15s ease-in-out infinite;
}

@keyframes wobble {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(2px, -2px);
    }

    50% {
        transform: translate(-1px, 1px);
    }

    75% {
        transform: translate(1px, 2px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* 3D Dart Visualization */
.dart-hand {
    position: absolute;
    bottom: 10%;
    right: 15%;
    transform-origin: center bottom;
    z-index: 105;
    perspective: 500px;
}

.dart-3d {
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: rotateX(-20deg) rotateY(10deg);
    transform-style: preserve-3d;
    animation: dartReady 2s ease-in-out infinite;
}

@keyframes dartReady {

    0%,
    100% {
        transform: rotateX(-20deg) rotateY(10deg) translateY(0);
    }

    50% {
        transform: rotateX(-20deg) rotateY(10deg) translateY(-5px);
    }
}

.dart-tip {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 20px solid #c0c0c0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.dart-barrel {
    width: 12px;
    height: 35px;
    background: linear-gradient(90deg, #4a4a4a 0%, #8a8a8a 50%, #4a4a4a 100%);
    border-radius: 2px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.dart-shaft {
    width: 6px;
    height: 25px;
    background: linear-gradient(90deg, #1a1a1a 0%, #3a3a3a 50%, #1a1a1a 100%);
}

.dart-flight {
    width: 30px;
    height: 25px;
    background: linear-gradient(135deg, var(--red) 0%, #8b0000 100%);
    clip-path: polygon(50% 0%, 100% 100%, 50% 80%, 0% 100%);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.5);
}

.dart-hand.throwing .dart-3d {
    animation: dartThrow 0.4s ease-in forwards;
}

@keyframes dartThrow {
    0% {
        transform: rotateX(-20deg) rotateY(10deg) translateY(0) scale(1);
        opacity: 1;
    }

    50% {
        transform: rotateX(0deg) rotateY(0deg) translateY(-100px) scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: rotateX(10deg) rotateY(0deg) translateY(-300px) scale(0.3);
        opacity: 0;
    }
}

/* Power Gauge Container */
.power-gauge-container {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.power-gauge-container.active {
    opacity: 1;
}

.power-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.power-gauge {
    position: relative;
    width: 30px;
    height: 250px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
}

.power-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top,
            var(--red) 0%,
            var(--gold) 40%,
            var(--green) 50%,
            var(--gold) 60%,
            var(--red) 100%);
    transition: height 0.05s linear;
    border-radius: 0 0 13px 13px;
}

.power-optimal {
    position: absolute;
    left: 0;
    width: 100%;
    height: 20%;
    top: 35%;
    background: rgba(0, 210, 106, 0.2);
    border-top: 2px solid var(--success);
    border-bottom: 2px solid var(--success);
}

.power-marker {
    position: absolute;
    left: -5px;
    width: calc(100% + 10px);
    height: 4px;
    background: white;
    border-radius: 2px;
    box-shadow: 0 0 10px white, 0 0 20px white;
    bottom: 0;
    transition: bottom 0.05s linear;
}

.power-zones {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* Throwing Instructions */
.throwing-instructions {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 24px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instruction-text {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    animation: instructionPulse 2s ease-in-out infinite;
}

@keyframes instructionPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Flying Dart Animation */
.dart-flying {
    position: absolute;
    width: 12px;
    height: 40px;
    pointer-events: none;
    z-index: 120;
    animation: flyToDart 0.5s ease-in forwards;
}

.dart-flying::before {
    content: '🎯';
    font-size: 20px;
}

@keyframes flyToDart {
    0% {
        transform: scale(1.5) rotate(-45deg);
        opacity: 1;
    }

    100% {
        transform: scale(0.5) rotate(-45deg);
        opacity: 0;
    }
}

/* Dartboard dim when throwing */
.dartboard-wrapper.throwing-mode #dartboard {
    filter: brightness(0.3) blur(2px);
    transition: filter 0.3s;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .game-area {
        grid-template-columns: 1fr;
    }

    .side-panel {
        max-height: 300px;
    }

    .dartboard-wrapper {
        max-width: 350px;
    }

    .power-gauge-container {
        left: 10px;
    }

    .power-gauge {
        height: 200px;
    }
}

@media (max-width: 600px) {
    .players-bar {
        flex-direction: column;
        gap: 12px;
    }

    .player-score {
        font-size: 1.4rem;
    }

    .dartboard-wrapper {
        max-width: 280px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-card {
        padding: 8px;
    }

    .stat-value {
        font-size: 1.1rem;
    }

    .dart-hand {
        right: 10%;
        bottom: 5%;
    }

    .power-gauge {
        height: 150px;
    }
}