/* =========================================================
   WebKolek Offline Cyber-Dino Runner Game Styles
   ========================================================= */

/* Offline Status Toast / Banner */
.offline-banner-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 99999;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    border: 1px solid rgba(255, 68, 56, 0.4);
    border-radius: 50px;
    padding: 10px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 68, 56, 0.2);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.offline-banner-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.offline-banner-toast.online-restored {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(16, 185, 129, 0.25);
}

.offline-pulse-dot {
    width: 10px;
    height: 10px;
    background-color: #ff4438;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(255, 68, 56, 0.7);
    animation: offlinePulse 1.8s infinite;
}

.online-restored .offline-pulse-dot {
    background-color: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: onlinePulse 1.8s infinite;
}

@keyframes offlinePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 68, 56, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(255, 68, 56, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 68, 56, 0); }
}

@keyframes onlinePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.offline-banner-btn {
    background: linear-gradient(135deg, #ff4438, #ff6b5b);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.offline-banner-btn:hover {
    transform: scale(1.05);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(255, 68, 56, 0.4);
}

.offline-banner-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}

.offline-banner-close:hover {
    color: #ffffff;
}

/* In-Page Offline Dino Game Modal */
.offline-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 29, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.offline-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.offline-game-wrapper {
    width: 100%;
    max-width: 760px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 68, 56, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.offline-modal-backdrop.active .offline-game-wrapper {
    transform: scale(1);
}

.offline-game-header {
    background: linear-gradient(135deg, #090e1a, #131d31);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.offline-game-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.offline-game-title span {
    color: #ff4438;
}

.offline-game-controls-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.offline-tool-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.offline-tool-btn:hover {
    background: rgba(255, 68, 56, 0.2);
    border-color: #ff4438;
    color: #ffffff;
}

.offline-close-btn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.offline-close-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Canvas Container */
.offline-canvas-container {
    position: relative;
    width: 100%;
    background: #f7f9fa;
    transition: background 0.4s ease;
    overflow: hidden;
}

.offline-canvas-container.night-mode {
    background: #111827;
}

.offline-canvas-container canvas,
#dinoCanvas,
#dinoModalCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 700 / 220;
    cursor: pointer;
}

/* Overlay UI inside game */
.offline-game-start-overlay,
.offline-game-over-overlay,
.offline-game-pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.offline-game-start-overlay.active,
.offline-game-over-overlay.active,
.offline-game-pause-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.offline-game-title-big {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.offline-game-subtitle {
    font-size: 13px;
    color: #e2e8f0;
    margin-bottom: 16px;
    font-weight: 500;
}

.offline-start-btn {
    background: linear-gradient(135deg, #ff4438, #ff6b5b);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255, 68, 56, 0.4);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.offline-start-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 24px rgba(255, 68, 56, 0.6);
}

/* Footer of Modal */
.offline-game-footer {
    background: #090e1a;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.offline-keys-hint {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #94a3b8;
    font-size: 12px;
    flex-wrap: wrap;
}

.offline-key-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 2px 8px;
    font-family: 'Consolas', monospace;
    font-weight: 700;
    color: #f1f5f9;
    font-size: 11px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

/* Touch controls for Mobile */
.offline-touch-controls {
    display: none;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .offline-touch-controls {
        display: flex;
    }
    .offline-keys-hint {
        display: none;
    }
}

.offline-touch-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.offline-touch-btn:active {
    background: rgba(255, 68, 56, 0.3);
    border-color: #ff4438;
}

/* Offline Page Full Layout (for standalone offline.html / offline.php) */
.offline-standalone-body {
    min-height: 100vh;
    background: radial-gradient(circle at 50% 20%, #172033 0%, #0a0f1d 100%);
    color: #f8fafc;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    margin: 0;
}

.offline-standalone-card {
    width: 100%;
    max-width: 820px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(255, 68, 56, 0.12);
}
