/* dino.css — celikezor chrome dino oyunu stilleri */

/* ── Layout wrapper ── */
.dino-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1rem 2rem;
    min-height: calc(100vh - 120px);
    box-sizing: border-box;
    position: relative;
    gap: 1.25rem;
}

/* ── Card ── */
.dino-card {
    background: rgba(10, 15, 25, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
    box-sizing: border-box;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Score row ── */
.dino-score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.dino-brand {
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: 2px;
    user-select: none;
}

.dino-scores {
    display: flex;
    gap: 0.75rem;
}

.dino-score-box {
    background: rgba(19, 34, 56, 0.35);
    border: 1px solid var(--surface-border);
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
    text-align: center;
    min-width: 85px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dino-score-label {
    display: block;
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.12rem;
}

.dino-score-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
}

/* ── Canvas wrapper — always 4:1 aspect ratio ── */
.dino-game-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4;
    /* 600 × 150 */
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
}

.dino-game-wrapper canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Bottom section ── */
.dino-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.dino-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0;
    max-width: 500px;
}

.dino-desc strong {
    color: var(--accent-color);
}

.dino-controls {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.dino-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    transition: background 0.18s ease, transform 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    user-select: none;
    min-height: 44px;
}

.dino-btn:hover {
    background: rgba(0, 210, 255, 0.10);
}

.dino-btn:active {
    transform: scale(0.97);
}

.dino-btn i {
    font-size: 0.88rem;
}

/* ── Fullscreen — game fills screen with padding on all sides ──
 *
 * Strategy:
 *   • The layout becomes a full-screen dark background
 *   • The card width is bounded by the smaller of:
 *       - 94vw  (horizontal padding ≈ 3vw each side)
 *       - (100vh - 210px) × 4  (keep canvas in-screen vertically;
 *         210px ≈ space for score row + controls + card padding)
 *   • The canvas inside the card keeps aspect-ratio: 4 and fills card width
 *   • Result: canvas is as large as possible while staying inside the screen
 */
.dino-layout:fullscreen,
.dino-layout:-webkit-full-screen {
    background: radial-gradient(ellipse at center, #0d1928 0%, #050810 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.dino-layout.fullscreen-active {
    background: radial-gradient(ellipse at center, #0d1928 0%, #050810 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 9999 !important;
}

/* Card in fullscreen: fill width while keeping canvas on screen vertically */
.dino-layout:fullscreen .dino-card,
.dino-layout:-webkit-full-screen .dino-card,
.dino-layout.fullscreen-active .dino-card {
    /* Max width = min(94vw, (available_height_for_canvas) * 4)
       ~210px reserved for header, controls, padding, gap */
    width: min(94vw, calc((100vh - 210px) * 4)) !important;
    max-width: none !important;
    background: rgba(8, 14, 24, 0.90) !important;
    border: 1px solid var(--surface-border) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7) !important;
    padding: 1.5rem !important;
}

/* ── Keyboard Keys ── */
.dino-instructions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    width: 100%;
}

.dino-inst-text {
    font-weight: 500;
}

.dino-keybinds {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.dino-keybind-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.dino-keys {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dino-key-or {
    font-size: 0.75rem;

}

.dino-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(19, 34, 56, 0.6);
    border: 1px solid rgba(0, 210, 255, 0.4);
    box-shadow: 0 2px 0 0 rgba(0, 210, 255, 0.2), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    min-width: 26px;
    height: 26px;
    box-sizing: border-box;
    text-transform: uppercase;
}

.dino-key.space {
    min-width: 70px;
    font-size: 0.75rem;
}

.dino-key i {
    font-size: 0.75rem;
}

/* ── Mobile Touch Controls ── */
.dino-touch-controls {
    display: none;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.5rem;
}

/* Only display on touch devices */
@media (pointer: coarse) {
    .dino-touch-controls {
        display: flex;
    }
}

.dino-touch-btn {
    pointer-events: auto;
    width: 100%;
    height: 48px;
    border-radius: 8px;
    background: rgba(19, 34, 56, 0.65);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    box-shadow: 0 3px 0 0 rgba(0, 210, 255, 0.3), 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: background 0.1s, transform 0.1s, box-shadow 0.1s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.dino-touch-btn:active {
    background: rgba(0, 210, 255, 0.3);
    transform: translateY(2px);
    box-shadow: 0 1px 0 0 rgba(0, 210, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Adjust card height subtraction on touch devices in fullscreen so everything fits */
@media (pointer: coarse) {
    .dino-layout.fullscreen-active .dino-card {
        width: min(94vw, calc((100vh - 330px) * 4)) !important;
    }
}

/* ──/* Responsive Adjustments */
@media (max-width: 600px) {
    .dino-layout {
        padding: 1rem 0.5rem;
    }

    .dino-card {
        padding: 1.25rem;
    }

    .dino-keys {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Mobile Touch Standardizations */
canvas, .dino-layout, .dino-card {
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .dino-layout {
        padding: 1.25rem 0.5rem;
    }

    .dino-card {
        padding: 1.1rem;
        gap: 0.9rem;
    }

    .dino-brand {
        font-size: 1.5rem;
    }

    .dino-score-box {
        padding: 0.35rem 0.65rem;
        min-width: 70px;
    }

    .dino-score-val {
        font-size: 1.05rem;
    }

    .dino-desc {
        font-size: 0.82rem;
    }

    .dino-btn {
        padding: 0.45rem 0.9rem;
        font-size: 0.82rem;
    }

    .dino-touch-btn {
        height: 44px;
        font-size: 0.95rem;
    }
}

/* Lider tablosu ile oyun kartı arasında boşluk */
#leaderboardDino {
    margin-top: 1.5rem;
}