/* style.css - Premium Japanese-style game interface styling */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700&family=Press+Start+2P&display=swap');

:root {
    --sakura-pink: #ffb7c5;
    --sakura-dark: #ff85a2;
    --japan-red: #bc002d;
    --japan-red-glow: rgba(188, 0, 45, 0.5);
    --dark-charcoal: #121214;
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.4);
    --glass-bg: rgba(20, 20, 25, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-white: #f8f9fa;
    --text-muted: #a0aec0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body {
    background-color: var(--dark-charcoal);
    font-family: 'Outfit', sans-serif;
    color: var(--text-white);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background image with Japanese vibe */
.game-container {
    position: relative;
    width: 1024px;
    height: 640px;
    background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.65)), url('assets/japan_street_bg.png') no-repeat center center;
    background-size: cover;
    border: 4px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Sakura Falling Particles */
.sakura-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.petal {
    position: absolute;
    background-color: var(--sakura-pink);
    border-radius: 150% 0 150% 150%;
    opacity: 0.85;
    transform-origin: left top;
    animation: fade 10s infinite linear, float 10s infinite ease-in-out;
}

@keyframes fade {
    0% { opacity: 0; }
    10% { opacity: 0.85; }
    90% { opacity: 0.85; }
    100% { opacity: 0; }
}

@keyframes float {
    0% {
        transform: translateY(-20px) translateX(0) rotate(0deg);
    }
    100% {
        transform: translateY(660px) translateX(200px) rotate(360deg);
    }
}

/* Screen Layouts */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

/* Title Screen */
.title-screen {
    background: rgba(18, 18, 20, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    padding: 40px;
}

.title-screen-logo-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Developer Info Card */
.dev-card {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    width: 340px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 183, 197, 0.1);
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.dev-card:hover {
    transform: translateY(-5px);
    border-color: var(--sakura-pink);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 183, 197, 0.25);
}

.dev-photo-container {
    width: 140px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    background: radial-gradient(circle, rgba(255, 183, 197, 0.25) 0%, rgba(0, 0, 0, 0.5) 100%);
    border: 2px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
}

.dev-card-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.dev-card-details {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dev-card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.dev-card-nrp {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--sakura-pink);
    margin-bottom: 4px;
    text-shadow: 0 0 5px var(--sakura-dark);
}

.dev-card-email {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.dev-card-email::before {
    content: '\f0e0'; /* FontAwesome envelope */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--sakura-dark);
}

.dev-card-course {
    font-size: 12px;
    color: var(--text-white);
    border-top: 1px solid var(--glass-border);
    padding-top: 10px;
    line-height: 1.4;
}

.dev-card-lecturer {
    font-size: 12px;
    color: var(--gold);
    font-weight: bold;
    margin-top: 2px;
    text-shadow: 0 0 5px var(--gold-glow);
}

.title-logo-container {
    text-align: center;
    margin-bottom: 24px;
}

.title-logo-sub {
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    color: var(--sakura-pink);
    text-shadow: 0 0 10px var(--sakura-dark);
    margin-bottom: 8px;
    letter-spacing: 2px;
    animation: pulse 2s infinite ease-in-out;
}

.title-logo-main {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 64px;
    background: linear-gradient(135deg, #fff 0%, var(--sakura-pink) 50%, var(--japan-red) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    letter-spacing: 1px;
}

.title-japanese {
    font-size: 28px;
    color: var(--japan-red);
    margin-top: 4px;
    font-weight: bold;
    text-shadow: 0 0 10px var(--japan-red-glow);
}

.btn-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 280px;
}

.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    font-size: 18px;
    color: var(--text-white);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    padding: 14px 28px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn:hover {
    border-color: var(--sakura-pink);
    box-shadow: 0 0 15px rgba(255, 183, 197, 0.4);
    transform: translateY(-2px);
    background: rgba(255, 183, 197, 0.1);
}

.btn-primary {
    background: var(--japan-red);
    border-color: var(--japan-red);
}

.btn-primary:hover {
    background: #e60037;
    border-color: #ff3366;
    box-shadow: 0 0 20px var(--japan-red-glow);
}

/* Audio control icon */
.audio-ctrl {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 100;
}

.audio-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.audio-btn:hover {
    transform: scale(1.05);
    border-color: var(--sakura-pink);
}

/* Game Interface */
.game-play-screen {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    padding: 24px;
    gap: 20px;
    z-index: 5;
}

/* HUD Panel Component */
.hud-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.hud-panel-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: var(--sakura-pink);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
}

/* Left Panel - Shiba Avatar & Emotion */
.shiba-avatar-container {
    width: 160px;
    height: 160px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 16px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.6);
}

.shiba-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.shiba-avatar.anxious {
    animation: shake 0.5s infinite alternate;
}

.shiba-avatar.crying {
    animation: cry-shake 0.3s infinite alternate;
}

.emotion-text {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
}

.emotion-text.happy {
    color: #48bb78;
    text-shadow: 0 0 8px rgba(72, 187, 120, 0.3);
}

.emotion-text.anxious {
    color: #ed8936;
    text-shadow: 0 0 8px rgba(237, 137, 54, 0.3);
}

.emotion-text.crying {
    color: #e53e3e;
    text-shadow: 0 0 8px rgba(229, 62, 62, 0.3);
}

.shiba-description {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
    line-height: 1.5;
}

/* Center Panel - The Game Canvas */
.canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 3px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

canvas {
    display: block;
}

/* Right Panel - Stats & Level */
.stat-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    width: 100%;
}

.level-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-white);
}

.step-counter-box {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    width: 100%;
    padding: 16px 8px;
    margin-bottom: 20px;
}

.step-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.step-count {
    font-family: 'Press Start 2P', monospace;
    font-size: 32px;
    color: var(--japan-red);
    text-shadow: 0 0 12px var(--japan-red-glow);
}

.step-count.low {
    color: #e53e3e;
    animation: flash 1s infinite alternate;
}

.restart-info {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
}

/* Dialog Screen (Helltaker Dialogue Style) */
.dialog-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 30px;
    z-index: 20;
}

.dialog-box {
    width: 100%;
    max-width: 800px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 2px solid var(--sakura-pink);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 183, 197, 0.2);
    display: grid;
    grid-template-columns: 200px 1fr;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dialog-avatar-side {
    background: rgba(0,0,0,0.3);
    border-right: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.dialog-avatar {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    object-fit: cover;
}

.dialog-content-side {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dialog-speaker {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    color: var(--sakura-pink);
    margin-bottom: 12px;
}

.dialog-text {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.dialog-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.choice-btn:hover {
    background: rgba(255, 183, 197, 0.15);
    border-color: var(--sakura-pink);
    padding-left: 20px;
}

.choice-bullet {
    color: var(--sakura-pink);
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
}

/* Failure Screen ("Tersesat") */
.fail-screen {
    background: radial-gradient(circle, rgba(20,20,30,0.9) 0%, rgba(5,5,10,0.98) 100%);
    backdrop-filter: blur(8px);
    text-align: center;
}

/* Rain Effect on failure screen */
.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.rain-drop {
    position: absolute;
    background: linear-gradient(transparent, rgba(174,194,224,0.4));
    width: 1.5px;
    height: 40px;
    animation: fall 1s linear infinite;
}

@keyframes fall {
    0% { transform: translateY(-50px); }
    100% { transform: translateY(660px); }
}

.fail-image {
    width: 320px;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    margin-bottom: 24px;
    z-index: 2;
}

.fail-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 32px;
    color: #e53e3e;
    text-shadow: 0 0 20px rgba(229, 62, 62, 0.6);
    margin-bottom: 12px;
    letter-spacing: 2px;
    z-index: 2;
}

.fail-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 500px;
    z-index: 2;
}

/* Victory Screen */
.victory-screen {
    background: radial-gradient(circle, rgba(40,20,35,0.9) 0%, rgba(10,5,10,0.98) 100%);
    backdrop-filter: blur(8px);
    text-align: center;
}

.victory-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 36px;
    color: var(--gold);
    text-shadow: 0 0 25px var(--gold-glow);
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.victory-subtitle {
    font-size: 20px;
    color: var(--sakura-pink);
    margin-bottom: 36px;
}

/* Utility Animations */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.03); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}

@keyframes flash {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

@keyframes cry-shake {
    0% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-4px) rotate(1deg); }
    100% { transform: translateY(0) rotate(-1deg); }
}

@keyframes slideUp {
    0% { transform: translateY(100px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
