/* ==========================================================================
   PRODUCTION GRADE - WIDYA 20TH BIRTHDAY APP (STYLES.CSS)
   ========================================================================== */

:root {
    --bg-app: #fdfbf7;
    --bg-card: #ffffff;
    --bg-card-alt: #f4f9f6;
    
    --primary-red: #d90429;
    --primary-red-hover: #b8001f;
    --fresh-green: #2a9d8f;
    --emerald-green: #10b981;
    --accent-gold: #d4af37;
    
    --text-main: #1d2d44;
    --text-muted: #5c677d;
    --border-color: rgba(42, 157, 143, 0.2);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 10px 30px rgba(42, 157, 143, 0.1);
    --shadow-red: 0 6px 20px rgba(217, 4, 41, 0.2);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
}

body.mobile-app-body {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* App Wrapper Container */
.app-wrapper {
    width: 100%;
    max-width: 460px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1rem 1.2rem 2rem;
    position: relative;
    margin: 0 auto;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.2rem 1.2rem;
}

.header-brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    user-select: none;
}

.badge-tag {
    background: rgba(42, 157, 143, 0.12);
    color: var(--fresh-green);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 800;
}

.header-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: all 0.2s;
}

.btn-icon:active { transform: scale(0.95); }

/* Screen Views */
.screen-view {
    display: none;
    flex-direction: column;
    flex: 1;
}

.screen-view.active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

/* App Cards */
.app-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.4rem;
    box-shadow: var(--shadow-card);
    position: relative;
}

.text-center { text-align: center; }

.status-chip {
    background: rgba(217, 4, 41, 0.08);
    color: var(--primary-red);
    font-weight: 800;
    font-size: 0.72rem;
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
}

.screen-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    line-height: 1.25;
    margin-bottom: 0.8rem;
    font-weight: 800;
}

.highlight-red { color: var(--primary-red); }
.highlight-green { color: var(--fresh-green); }

.screen-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.8rem;
    line-height: 1.5;
}

.countdown-box {
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    padding: 1.2rem 0.8rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.countdown-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fresh-green);
    margin-bottom: 0.8rem;
}

.countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.timer-unit {
    background: white;
    padding: 0.6rem 0.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(42, 157, 143, 0.15);
}

.timer-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-red);
}

.timer-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

/* Step Progress Bar */
.step-progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    padding: 0 0.5rem;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid #dee2e6;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.step-dot.active {
    background: var(--fresh-green);
    border-color: var(--fresh-green);
    color: white;
    transform: scale(1.08);
}

.step-dot.completed {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

.step-line {
    flex: 1;
    height: 3px;
    background: #dee2e6;
    margin: 0 0.4rem;
    transition: background 0.3s;
}

.step-line.active { background: var(--fresh-green); }

/* Main Game Card Container */
.main-game-card {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Buttons */
.btn-action-primary {
    width: 100%;
    padding: 0.9rem;
    background: var(--fresh-green);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(42, 157, 143, 0.25);
    transition: all 0.2s;
    margin-top: 1rem;
}

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

.btn-action-red {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: var(--shadow-red);
    transition: all 0.2s;
    margin-top: 1rem;
}

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

.btn-link-subtle {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.72rem;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 0.6rem;
}

/* Game 1: Memory Match Grid */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin: 1.2rem 0;
}

.memory-card-btn {
    aspect-ratio: 1;
    background: var(--bg-card-alt);
    border: 1.5px solid var(--fresh-green);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s, background 0.3s;
}

.memory-card-btn.flipped {
    background: white;
    border-color: var(--primary-red);
    transform: rotateY(180deg);
}

.memory-card-btn.matched {
    background: rgba(217, 4, 41, 0.12);
    border-color: var(--primary-red);
    pointer-events: none;
}

/* Game 2: Writing Canvas */
.drawing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin: 0.8rem 0;
}

#drawCanvas {
    background: #ffffff;
    border: 2px dashed var(--primary-red);
    border-radius: var(--radius-md);
    touch-action: none;
    cursor: crosshair;
    box-shadow: var(--shadow-soft);
}

.palette-tools {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-dot.active { border-color: var(--text-main); transform: scale(1.15); }

.btn-tool-sm {
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: white;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

/* Game 3: Catch The Cake Arena */
.catch-arena {
    width: 100%;
    height: 260px;
    background: #fffdf7;
    border: 1.5px solid var(--fresh-green);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    margin: 1rem 0;
    touch-action: none;
}

#basketObj {
    position: absolute;
    bottom: 10px;
    width: 70px;
    height: 32px;
    background: var(--fresh-green);
    color: white;
    border-radius: 0 0 14px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    user-select: none;
}

.falling-cake {
    position: absolute;
    font-size: 1.5rem;
    user-select: none;
}

/* Wish Card & Photo Frame */
.wish-card-content {
    text-align: center;
    padding: 0.5rem 0;
}

.wish-card-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--primary-red);
    margin-bottom: 0.8rem;
}

.wish-card-text {
    font-size: 0.92rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

/* Photo Polaroid inside Wish Card */
.wish-photo-polaroid {
    background: white;
    padding: 0.8rem 0.8rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    margin: 1rem 0;
}

.wish-photo-polaroid img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
}

.photo-caption {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 0.6rem;
}

/* Luxury Grand Finale Box */
.finale-luxury-card {
    border: 2px solid var(--accent-gold);
    background: linear-gradient(135deg, #ffffff 0%, #fffdfa 100%);
    box-shadow: 0 12px 35px rgba(212, 175, 55, 0.2);
}

.luxury-badge {
    background: rgba(214, 175, 55, 0.12);
    color: #b8860b;
    border: 1px solid rgba(212, 175, 55, 0.4);
}

.finale-sparkle-box {
    margin: 1.8rem 0;
    padding: 2.5rem 1.5rem;
    background: radial-gradient(circle, rgba(255, 248, 220, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: var(--radius-md);
    border: 1px dashed rgba(212, 175, 55, 0.4);
}

.finale-big-number {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary-red);
    line-height: 1;
}

.finale-sub-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: #b8860b;
    margin-top: 0.5rem;
    letter-spacing: 1px;
}

/* Feedback Mini Card */
.feedback-mini-card {
    background: white;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.9rem;
    margin-top: 1.2rem;
    box-shadow: var(--shadow-soft);
}

.feedback-header {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fresh-green);
    margin-bottom: 0.5rem;
}

.feedback-input-group {
    display: flex;
    gap: 0.5rem;
}

.feedback-input-group input {
    flex: 1;
    background: var(--bg-card-alt);
    border: 1px solid var(--border-color);
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    outline: none;
    font-family: var(--font-body);
}

.feedback-input-group input:focus { border-color: var(--primary-red); }

.btn-send {
    background: var(--fresh-green);
    border: none;
    color: white;
    padding: 0 1.1rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}

.feedback-toast {
    font-size: 0.75rem;
    color: var(--emerald-green);
    font-weight: 700;
    margin-top: 0.4rem;
    text-align: center;
}

.hidden { display: none !important; }

/* Secret Admin Modal & PIN Security */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(29, 45, 68, 0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.admin-modal-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.4rem;
    max-width: 450px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-close-btn {
    position: absolute;
    top: 0.8rem;
    right: 1.2rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.modal-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* PIN Security Input */
.pin-view-container {
    padding: 1rem 0;
}

.pin-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }

.pin-input-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.2rem 0 0.8rem;
}

.pin-input-group input {
    width: 110px;
    text-align: center;
    letter-spacing: 6px;
    font-size: 1.2rem;
    font-weight: 800;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    outline: none;
}

.btn-primary-sm {
    padding: 0.5rem 1.2rem;
    background: var(--fresh-green);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.pin-error {
    color: var(--primary-red);
    font-weight: 700;
    font-size: 0.78rem;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.admin-tab {
    flex: 1;
    padding: 0.6rem 0;
    background: none;
    border: none;
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.admin-tab.active {
    color: var(--fresh-green);
    border-bottom-color: var(--fresh-green);
}

.feedback-list, .telemetry-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.feedback-item, .log-item {
    background: var(--bg-card-alt);
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    border-left: 3.5px solid var(--fresh-green);
}

.log-item { border-left-color: var(--primary-red); }

.feedback-item .time, .log-item .time {
    font-size: 0.68rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.2rem;
}

/* Form Editor Surat */
.editor-form-container {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.editor-section {
    background: var(--bg-card-alt);
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.editor-section h4 {
    font-size: 0.85rem;
    color: var(--primary-red);
    font-family: var(--font-heading);
}

.editor-section input, .editor-section textarea {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid #d1d5db;
    font-size: 0.82rem;
    font-family: var(--font-body);
    outline: none;
}

.editor-section input:focus, .editor-section textarea:focus {
    border-color: var(--fresh-green);
}

.empty-state {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 1.8rem 0;
}

.btn-danger-sm {
    width: 100%;
    padding: 0.65rem;
    background: #e63946;
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
