/* ========================================
   Bandung Step Rush - Game Style CSS
   ======================================== */

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   App Container - Full viewport
   ======================================== */
.app-container {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Dual Background Layers
   ======================================== */
.bg-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    z-index: 0;
    transition: opacity 0.8s ease;
}

.bg-light {
    background-image: url('asset/BACKGROUN HP (2).png');
    opacity: 1;
}

.bg-dark {
    background-image: url('asset/BACKGROUN HP (1).png');
    opacity: 0;
}

/* Swap to dark road background for failed state */
.app-container.state-failed .bg-light {
    opacity: 0;
}

.app-container.state-failed .bg-dark {
    opacity: 1;
}

/* ========================================
   Content Layout
   ======================================== */
.content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep scrollable */
.content::-webkit-scrollbar {
    display: none;
}

.content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ========================================
   Logo Section
   ======================================== */
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding-top: 8px;
}

.logo-game {
    width: 180px;
    height: auto;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.35));
    animation: floatIn 0.8s ease-out both;
}

/* ========================================
   Register Card (Asset-based Form)
   ======================================== */
.register-card-wrapper {
    position: relative;
    width: 85%;
    max-width: 320px;
    animation: slideUp 0.7s ease-out 0.2s both;
    flex-shrink: 0;
}

.register-card-img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.25));
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.register-form-overlay {
    position: absolute;
    inset: 0;
}

/* Transparent inputs positioned over the card's field areas */
.register-input {
    position: absolute;
    left: 10%;
    width: 80%;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #7A5C12;
    text-align: center;
    padding: 0 10px;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.register-input::placeholder {
    color: #C4A86C;
    font-weight: 400;
    font-size: 13px;
}

.register-input:focus {
    background: rgba(255, 255, 255, 0.35);
}

/* Exact positions aligned to ASSET-REGISTER-.png field areas */
.register-input-name {
    top: 26%;
    height: 6.5%;
}

.register-input-email {
    top: 46.5%;
    height: 6.5%;
}

.register-input-wa {
    top: 66.5%;
    height: 6.5%;
}

/* Invisible button overlay on the START graphic */
.register-btn {
    position: absolute;
    top: 83%;
    left: 18%;
    width: 64%;
    height: 9%;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 30px;
    transition: transform 0.15s ease, opacity 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.register-btn:hover {
    transform: scale(1.03);
}

.register-btn:active {
    transform: scale(0.95);
    opacity: 0.7;
}

/* ========================================
   Onboarding Container & Card
   ======================================== */
.onboarding-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease-out;
    flex: 1;
    min-height: 0;
}

.onboarding-card {
    width: 100%;
    max-width: 360px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ========================================
   Game Panel (Queue/Waiting States)
   Golden-bordered card matching the game aesthetic
   ======================================== */
.game-panel {
    width: 88%;
    max-width: 320px;
    background: linear-gradient(180deg, #FFF5D6 0%, #F5E6B8 100%);
    border: 4px solid #E8A020;
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow:
        0 0 0 3px #C47E0A,
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.6);
    text-align: center;
    position: relative;
}

.game-panel-icon {
    font-size: 56px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
    animation: bounceSoft 2s infinite ease-in-out;
}

.game-panel-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 22px;
    color: #8B4513;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    margin-bottom: 10px;
}

.game-panel-title-green {
    color: #2D8B2D;
}

.game-panel-text {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: #8B6914;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 20px;
}

.game-panel-steps {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    color: #8B4513;
    font-weight: 700;
    margin-bottom: 16px;
}

.game-panel-steps b {
    font-size: 20px;
    color: #C47E0A;
}

/* ========================================
   Game Buttons
   ======================================== */
.game-btn {
    display: inline-block;
    padding: 14px 36px;
    border: 3px solid #3D8A20;
    border-radius: 40px;
    background: linear-gradient(180deg, #7CDB3C 0%, #5CB832 50%, #4AA828 100%);
    cursor: pointer;
    box-shadow:
        0 4px 12px rgba(76, 168, 40, 0.4),
        0 2px 0 #3D8A20,
        inset 0 2px 0 rgba(255, 255, 255, 0.35);
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 20px;
    color: #fff;
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.25),
        -1px -1px 0 #3D8A20,
        1px -1px 0 #3D8A20,
        -1px 1px 0 #3D8A20,
        1px 1px 0 #3D8A20;
    letter-spacing: 2px;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 16px rgba(76, 168, 40, 0.5),
        0 4px 0 #3D8A20,
        inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.game-btn:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 6px rgba(76, 168, 40, 0.3),
        0 0 0 #3D8A20,
        inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Orange variant */
.game-btn-orange {
    background: linear-gradient(180deg, #FFE066 0%, #F5B731 30%, #E8941A 70%, #D4800F 100%);
    border-color: #A05A00;
    box-shadow:
        0 4px 12px rgba(200, 120, 0, 0.4),
        0 2px 0 #C67A0A,
        inset 0 2px 0 rgba(255, 255, 255, 0.35);
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 0.25),
        -1px -1px 0 #B06800,
        1px -1px 0 #B06800,
        -1px 1px 0 #B06800,
        1px 1px 0 #B06800;
}

.game-btn-orange:hover {
    box-shadow:
        0 6px 16px rgba(200, 120, 0, 0.5),
        0 4px 0 #C67A0A,
        inset 0 2px 0 rgba(255, 255, 255, 0.35);
}

.game-btn-orange:active {
    box-shadow:
        0 2px 6px rgba(200, 120, 0, 0.3),
        0 0 0 #C67A0A,
        inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Result Cards (Congratulation / Failed)
   ======================================== */
.result-card-wrapper {
    position: relative;
    width: 88%;
    max-width: 320px;
    margin: 0 auto;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.result-card-img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.3));
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Text overlays positioned over Congratulation card fields */
.result-overlay-name,
.result-overlay-time {
    position: absolute;
    left: 15%;
    width: 70%;
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: #7A5C12;
    pointer-events: none;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-overlay-name {
    top: 48%;
    font-size: 18px;
}

.result-overlay-time {
    top: 70%;
    font-size: 18px;
}

/* Footer below result cards */
.result-footer {
    width: 88%;
    max-width: 320px;
    text-align: center;
    margin-top: 16px;
    animation: slideUp 0.5s ease-out 0.3s both;
}

.result-footer .auto-redirect-note {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Steps display in failed footer */
.result-steps-display {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    color: #fff;
    font-weight: 700;
    margin-bottom: 14px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.result-steps-display b {
    font-size: 22px;
    color: #FFD700;
}

/* ========================================
   Modal Styles
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 10, 40, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(160deg, #FFF5D6 0%, #F5E6B8 100%);
    border: 3px solid #E8A020;
    border-radius: 24px;
    padding: 36px 32px;
    text-align: center;
    max-width: 340px;
    width: 100%;
    box-shadow:
        0 0 0 3px #C47E0A,
        0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.modal-content h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: #8B4513;
    margin-bottom: 8px;
}

.modal-content p {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: #8B6914;
    line-height: 1.5;
    margin-bottom: 20px;
}

.btn-modal {
    padding: 12px 40px;
    border: 2px solid #3D8A20;
    border-radius: 30px;
    background: linear-gradient(180deg, #7CDB3C 0%, #5CB832 50%, #4AA828 100%);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76, 168, 40, 0.4);
    transition: all 0.2s ease;
}

.btn-modal:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(76, 168, 40, 0.5);
}

.modal-error h2 {
    color: #c0392b;
}

.btn-modal-error {
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    border-color: #962D22;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.4);
}

.btn-modal-error:hover {
    box-shadow: 0 6px 16px rgba(192, 57, 43, 0.5);
}

/* ========================================
   Animations
   ======================================== */
@keyframes floatIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceSoft {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* ========================================
   Responsive - Short screens
   ======================================== */
@media (max-height: 700px) {
    .content {
        gap: 4px;
        padding: 12px 16px 10px;
    }

    .logo-game {
        width: 140px;
    }

    .logo-section {
        padding-top: 4px;
    }

    .register-card-wrapper {
        width: 78%;
        max-width: 280px;
    }

    .register-input {
        font-size: 13px;
    }

    .register-input::placeholder {
        font-size: 11px;
    }

    .game-panel {
        padding: 24px 20px;
    }

    .game-panel-icon {
        font-size: 44px;
        margin-bottom: 10px;
    }

    .game-panel-title {
        font-size: 18px;
    }

    .game-panel-text {
        font-size: 13px;
        margin-bottom: 14px;
    }

    .game-btn {
        padding: 10px 28px;
        font-size: 18px;
    }

    .result-card-wrapper {
        width: 78%;
        max-width: 280px;
    }

    .result-overlay-name,
    .result-overlay-time {
        font-size: 15px;
    }
}

@media (max-height: 580px) {
    .content {
        gap: 2px;
        padding: 6px 12px 6px;
    }

    .logo-game {
        width: 110px;
    }

    .logo-section {
        padding-top: 2px;
    }

    .register-card-wrapper {
        width: 70%;
        max-width: 240px;
    }

    .register-input {
        font-size: 11px;
    }

    .register-input::placeholder {
        font-size: 10px;
    }

    .game-panel {
        padding: 16px 14px;
    }

    .game-panel-icon {
        font-size: 36px;
        margin-bottom: 6px;
    }

    .game-panel-title {
        font-size: 16px;
    }

    .game-panel-text {
        font-size: 11px;
        margin-bottom: 10px;
    }

    .game-btn {
        padding: 8px 22px;
        font-size: 15px;
    }

    .result-card-wrapper {
        width: 68%;
        max-width: 220px;
    }

    .result-overlay-name,
    .result-overlay-time {
        font-size: 13px;
    }
}

/* Desktop - wider viewport */
@media (min-width: 768px) {
    .content {
        max-width: 460px;
    }

    .logo-game {
        width: 220px;
    }

    .register-card-wrapper {
        max-width: 360px;
    }

    .result-card-wrapper {
        max-width: 360px;
    }
}