﻿@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Ubuntu:wght@400;500;700&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    background: #0a0f1a;
    font-family: 'Press Start 2P', monospace;
    font-size: 78%;
    user-select: none;
    -webkit-user-select: none
}

/* Ubuntu khusus chat / inbox / kode room — specificity tinggi */
#game-container #chat-sidebar,
#game-container #chat-sidebar *:not(.bi):not(i),
#game-container #chat-toggle-btn,
#game-container #chat-toggle-btn *:not(.bi):not(i),
#game-container #chat-input,
#game-container #chat-send-btn,
#game-container #chat-messages,
#game-container #chat-messages *:not(.bi):not(i),
#game-container .chat-header,
#game-container .chat-header *:not(.bi):not(i),
#game-container .chat-msg,
#game-container .chat-msg *:not(.bi):not(i),
#game-container .chat-input-area,
#game-container .chat-input-area *:not(.bi):not(i),
#game-container .chat-system-msg,
#game-container .chat-share-btn,
#game-container .chat-online-badge,
#game-container .chat-online-badge *:not(.bi):not(i),
#game-container .chat-msg-bubble,
#game-container .chat-msg-name,
#game-container .chat-msg-time,
#game-container .chat-header-title,
#game-container #inbox-sidebar,
#game-container #inbox-sidebar *:not(.bi):not(i),
#game-container #inbox-toggle-btn,
#game-container #inbox-toggle-btn *:not(.bi):not(i),
#game-container #inbox-messages-list,
#game-container #inbox-messages-list *:not(.bi):not(i),
#game-container .inbox-header,
#game-container .inbox-header *:not(.bi):not(i),
#game-container .inbox-card,
#game-container .inbox-card *:not(.bi):not(i),
#game-container .inbox-card-title,
#game-container .inbox-card-content,
#game-container .inbox-reward-box,
#game-container .inbox-reward-box *:not(.bi):not(i),
#game-container .inbox-claim-btn,
#game-container .inbox-header-title,
#game-container .room-code-box,
#game-container .room-code-box *:not(.bi):not(i),
#game-container .room-code-value,
#game-container .room-code-label,
#game-container .room-code-copy,
#game-container .history-room-code,
#game-container #room-code-display,
#game-container #room-code-input,
#game-container #join-code-input,
#game-container #join-by-code-input {
    font-family: 'Ubuntu', sans-serif !important;
    letter-spacing: normal !important;
}

#desktop-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 20% 50%, rgba(34, 197, 94, 0.08) 0%, transparent 60%), radial-gradient(ellipse at 80% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 60%), #0a0f1a
}

#mobile-frame {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #060d18;
    overflow: hidden;
    display: flex;
    flex-direction: column
}

@media (min-width:600px) {
    #mobile-frame {
        width: 360px;
        height: 760px;
        border-radius: 36px;
        box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3), 0 0 0 3px rgba(15, 23, 42, 0.8), 0 0 0 4px rgba(34, 197, 94, 0.15), 0 32px 80px rgba(0, 0, 0, 0.7), 0 0 60px rgba(34, 197, 94, 0.12), 0 0 120px rgba(59, 130, 246, 0.06)
    }

    #mobile-frame::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 36px;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%, transparent 60%, rgba(0, 0, 0, 0.15) 100%);
        pointer-events: none;
        z-index: 9998
    }

    #mobile-frame::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 88px;
        height: 24px;
        background: #060d18;
        border-radius: 16px;
        z-index: 100;
        box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2), inset 0 0 8px rgba(0, 0, 0, 0.5)
    }
}

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 0
}

#game-container canvas {
    display: block;
    border-radius: 12px;
    image-rendering: pixelated;
    image-rendering: crisp-edges
}

#status-bar {
    display: none
}

@media (min-width:600px) {
    #status-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 22px 0;
        height: 40px;
        font-size: 8px;
        font-weight: normal;
        font-family: 'Press Start 2P', monospace;
        color: rgba(34, 197, 94, 0.7);
        letter-spacing: 1px;
        pointer-events: none;
        flex-shrink: 0;
        text-shadow: 0 0 8px rgba(34, 197, 94, 0.4)
    }
}

#fullscreen-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 5, 15, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none
}

#fullscreen-modal-overlay.show {
    opacity: 1;
    pointer-events: auto
}

.fullscreen-modal-card {
    background: rgba(10, 20, 40, 0.95);
    border: 2px solid rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15), 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(34, 197, 94, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    width: 90%;
    max-width: 320px;
    padding: 28px 24px;
    text-align: center;
    transform: scale(0.88) translateY(12px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Press Start 2P', monospace;
    position: relative;
    overflow: hidden
}

.fullscreen-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.04) 3px, rgba(0, 0, 0, 0.04) 4px);
    pointer-events: none;
    z-index: 0;
    border-radius: 20px
}

#fullscreen-modal-overlay.show .fullscreen-modal-card {
    transform: scale(1) translateY(0)
}

.fullscreen-modal-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #22c55e;
    margin-bottom: 16px;
    line-height: 1.6;
    text-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
    position: relative;
    z-index: 1;
    letter-spacing: 1px
}

.fullscreen-modal-body {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 28px;
    line-height: 1.6;
    font-weight: 600;
    position: relative;
    z-index: 1
}

.fullscreen-modal-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    position: relative;
    z-index: 1
}

.fullscreen-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    padding: 12px 18px;
    border-radius: 10px;
    border: 2px solid;
    cursor: pointer;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.12s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100px;
    position: relative;
    overflow: hidden;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.4)
}

.fullscreen-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-20deg)
}

.fullscreen-btn:hover::after {
    animation: btn-shimmer 0.4s ease forwards
}

@keyframes btn-shimmer {
    to {
        left: 200%
    }
}

.fullscreen-btn:active {
    transform: translateY(2px) scale(0.97)
}

.fullscreen-btn-yes {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    border-color: #15803d;
    box-shadow: 0 4px 0 #14532d, 0 4px 12px rgba(34, 197, 94, 0.3)
}

.fullscreen-btn-yes:hover {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 4px 0 #14532d, 0 6px 16px rgba(34, 197, 94, 0.4);
    transform: translateY(-1px)
}

.fullscreen-btn-yes:active {
    box-shadow: 0 1px 0 #14532d, 0 2px 6px rgba(34, 197, 94, 0.2);
    transform: translateY(3px)
}

.fullscreen-btn-no {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    border-color: #991b1b;
    box-shadow: 0 4px 0 #7f1d1d, 0 4px 12px rgba(239, 68, 68, 0.3)
}

.fullscreen-btn-no:hover {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 4px 0 #7f1d1d, 0 6px 16px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px)
}

.fullscreen-btn-no:active {
    box-shadow: 0 1px 0 #7f1d1d, 0 2px 6px rgba(239, 68, 68, 0.2);
    transform: translateY(3px)
}

#page-transition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #060d18 0%, #0a1525 100%);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.28s ease-out;
    pointer-events: auto
}

#page-transition-overlay.fade-out {
    opacity: 0;
    pointer-events: none
}

.transition-content {
    text-align: center;
    font-family: 'Press Start 2P', monospace
}

.transition-title {
    font-size: 8px;
    color: #22c55e;
    text-shadow: 0 0 12px rgba(34, 197, 94, 0.6), 0 0 24px rgba(34, 197, 94, 0.3);
    animation: transition-pulse 1s infinite ease-in-out;
    margin-bottom: 14px;
    letter-spacing: 2px
}

.transition-bar-container {
    width: 120px;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 4px;
    margin: 0 auto;
    overflow: hidden
}

.transition-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #16a34a 0%, #22c55e 50%, #4ade80 100%);
    border-radius: 3px;
    animation: transition-fill-load 0.8s infinite linear;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5)
}

@keyframes transition-pulse {

    0%,
    100% {
        opacity: 0.5
    }

    50% {
        opacity: 1
    }
}

@keyframes transition-fill-load {
    0% {
        width: 0%
    }

    100% {
        width: 100%
    }
}

.jalur-preview-box {
    margin-top: 16px;
    width: calc(100% - 28px);
    max-width: 316px;
    background: rgba(15, 23, 42, 0.65);
    border: 1.5px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(34, 197, 94, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-sizing: border-box;
    z-index: 12;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px)
}

.jalur-preview-box .preview-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 8px;
    color: #22c55e;
    margin-bottom: 6px;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.5)
}

.jalur-preview-box .canvas-container {
    width: 260px;
    height: 70px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid rgba(34, 197, 94, 0.2)
}

.jalur-preview-box .canvas-container canvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges
}

.jalur-preview-box .preview-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 13px;
    font-weight: bold;
    color: #f59e0b;
    margin-top: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.4)
}

.scrollable {
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y !important;
    overscroll-behavior: contain;
}

:fullscreen #mobile-frame,
:-webkit-full-screen #mobile-frame,
:-moz-full-screen #mobile-frame,
:-ms-fullscreen #mobile-frame,
#mobile-frame:fullscreen,
#mobile-frame:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    box-shadow: none !important
}

:fullscreen #mobile-frame::before,
:-webkit-full-screen #mobile-frame::before,
:-moz-full-screen #mobile-frame::before,
:-ms-fullscreen #mobile-frame::before {
    display: none !important
}

:fullscreen #mobile-frame::after,
:-webkit-full-screen #mobile-frame::after,
:-moz-full-screen #mobile-frame::after,
:-ms-fullscreen #mobile-frame::after {
    display: none !important
}

input,
textarea,
select {
    user-select: text !important;
    -webkit-user-select: text !important;
    touch-action: auto !important;
    pointer-events: auto !important
}