/* ==========================================================================
   VƯƠNG QUỐC LOSER - CYBERPUNK DYSTOPIAN STYLESHEET
   ========================================================================== */

:root {
    --bg-dark: #0a0b10;
    --bg-card: #12141e;
    --bg-card-hover: #191c2b;
    --border-color: #262a3d;
    --danger-red: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.4);
    --warning-amber: #f59e0b;
    --cyber-cyan: #06b6d4;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-mono: 'Consolas', 'Courier New', monospace;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Clean scanline-free dark mode */

/* App Header & Vitals Bar */
.app-header {
    background: rgba(18, 20, 30, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
}

.brand-title {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    letter-spacing: 1px;
}

/* User Vitals (HP, XP, Level, Rank) */
.vitals-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.vital-box {
    min-width: 180px;
}

.vital-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.hp-bar-bg, .xp-bar-bg {
    width: 100%;
    height: 14px;
    background: #1e2235;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 1px solid #333a54;
}

.hp-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #b91c1c, #ef4444);
    box-shadow: 0 0 12px var(--danger-glow);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hp-bar-fill.warning {
    background: linear-gradient(90deg, #d97706, #f59e0b);
}

.hp-bar-fill.critical {
    animation: hpCriticalPulse 0.8s infinite;
}

@keyframes hpCriticalPulse {
    0%, 100% { background: #ef4444; opacity: 1; }
    50% { background: #7f1d1d; opacity: 0.5; }
}

.xp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0284c7, #06b6d4);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
    transition: width 0.4s ease;
}

.rank-badge {
    background: #1c2032;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-align: right;
}

.rank-lvl {
    font-size: 0.75rem;
    color: var(--cyber-cyan);
    font-family: var(--font-mono);
    font-weight: bold;
}

.rank-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--warning-amber);
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Procrastination Watcher Banner */
.watcher-alert-banner {
    background: #7f1d1d;
    border-bottom: 2px solid #ef4444;
    padding: 0.7rem 2rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    animation: alertFlash 1.5s infinite;
}

@keyframes alertFlash {
    0%, 100% { background-color: #7f1d1d; }
    50% { background-color: #991b1b; }
}

.watcher-text {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
}

/* Main Layout Grid */
.main-wrapper {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .main-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Cards & Sections */
.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.8rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

.card-header-styled {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.8rem;
    margin-bottom: 1.2rem;
}

.card-header-styled h2 {
    font-size: 1.15rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
}

/* Quarantine Focus Arena */
.quarantine-arena {
    border: 2px solid #3b4261;
}

.quarantine-arena.in-session {
    border-color: var(--danger-red);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
}

.timer-display {
    font-size: 4rem;
    font-family: var(--font-mono);
    font-weight: 900;
    text-align: center;
    letter-spacing: 4px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    margin: 1.2rem 0;
}

.timer-display.ticking {
    color: var(--danger-red);
    text-shadow: 0 0 25px var(--danger-glow);
}

.active-task-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.active-task-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--warning-amber);
}

.active-task-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.3rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.4rem;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 15px var(--danger-glow);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
}

.btn-secondary {
    background: #272c40;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #363c59;
}

.btn-block {
    width: 100%;
}

.arena-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Verification Box */
.verification-box {
    background: #0e1019;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.2rem;
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #171a27;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-textarea {
    min-height: 110px;
    resize: vertical;
    font-family: var(--font-mono);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--cyber-cyan);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

/* Sarcasm AI Roast Feed */
.roast-feed {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 380px;
    overflow-y: auto;
}

.roast-bubble {
    background: #181b29;
    border-left: 4px solid var(--danger-red);
    padding: 0.8rem 1rem;
    border-radius: 0 6px 6px 0;
    position: relative;
    font-size: 0.9rem;
}

.roast-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
    font-family: var(--font-mono);
}

.roast-text {
    color: #fca5a5;
    font-style: italic;
    line-height: 1.4;
}

.roast-speak-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
}

.roast-speak-btn:hover {
    color: #fff;
}

/* Mystery Box Section */
.mystery-wheel-card {
    text-align: center;
    border-color: #831843;
}

.mystery-icon-spin {
    font-size: 3rem;
    margin: 0.5rem 0;
    display: inline-block;
    animation: wobbleBox 3s infinite ease-in-out;
}

@keyframes wobbleBox {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-8deg) scale(1.05); }
    75% { transform: rotate(8deg) scale(1.05); }
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-content {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    max-width: 550px;
    width: 100%;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.bankruptcy-banner {
    background: #450a0a;
    border: 2px solid var(--danger-red);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    margin: 1rem;
    display: none;
}
.bankruptcy-banner h2 { color: var(--danger-red); font-size: 1.3rem; }
/* Responsive layout uses the real viewport, never a simulated phone frame. */
.app-viewport-shell { width: 100%; min-width: 0; }
.brand-identity { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.brand-identity > div:last-child { min-width: 0; }
.header-actions { display: flex; gap: .4rem; flex-shrink: 0; }
.brand-section { min-width: 0; flex-wrap: wrap; }
.vital-label { gap: .5rem; flex-wrap: wrap; }
.main-wrapper { grid-template-columns: minmax(0, 1fr) minmax(0, 380px); }
.left-col, .right-col, .dashboard-card { min-width: 0; overflow-wrap: anywhere; }
.card-header-styled { flex-wrap: wrap; gap: .6rem; }
.task-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-input, .form-select, .form-textarea { max-width: 100%; min-width: 0; }
.modal-content { max-height: 90dvh; overflow-y: auto; }
.discipline-notice, .speech-status { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; z-index: 2000; padding: 1rem; border: 1px solid var(--cyber-cyan); background: var(--bg-card); border-radius: 8px; }
.discipline-notice { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.hp-bar-fill.critical, .watcher-alert-banner { animation: none; }
@media (max-width: 1024px) { .main-wrapper { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 768px) {
    .app-header { position: static; padding: .65rem max(.8rem, env(safe-area-inset-left)); backdrop-filter: none; }
    .header-container { display: grid; gap: .6rem; }
    .brand-section { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .5rem; }
    .brand-identity { gap: .4rem; }
    .brand-logo { font-size: 1.5rem; }
    .brand-title { font-size: clamp(.9rem, 3.8vw, 1.2rem); letter-spacing: .4px; line-height: 1.3; overflow-wrap: anywhere; }
    .brand-subtitle { display: none; }
    .header-actions .btn { min-height: 44px; padding: .4rem .55rem; font-size: .7rem; }
    .vitals-container { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem .8rem; }
    .vital-box { min-width: 0; }
    .vital-label { font-size: .65rem; margin-bottom: .15rem; }
    .hp-bar-bg { height: 7px; }
    .rank-badge { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .25rem .5rem; text-align: left; min-width: 0; }
    .rank-title { max-width: none; white-space: normal; font-size: .7rem; line-height: 1.3; }
    .rank-lvl { flex-shrink: 0; font-size: .65rem; }
    .main-wrapper { padding: 0 .8rem; margin: 1rem auto; gap: 1rem; }
    .dashboard-card { padding: 1rem; }
    .card-header-styled h2 { font-size: 1.05rem; }
    .timer-display { font-size: 3.5rem; }
    .btn { min-height: 44px; white-space: normal; }
    .task-options { grid-template-columns: minmax(0,1fr); }
    .watcher-alert-banner, .watcher-text { flex-wrap: wrap; padding: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* A mobile HUD is two small rows at rest, one row while scrolling. */
.calendar-help, #calendar-status, #calendar-setup { font-size: .85rem; margin: .7rem 0; }
.calendar-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.calendar-events { list-style: none; display: grid; gap: .75rem; margin-top: 1rem; }
.calendar-events li { padding: .8rem; background: var(--bg-dark); border: 1px solid var(--border-color); border-radius: 8px; }
.calendar-events p { color: var(--text-muted); font-size: .8rem; margin: .4rem 0; }
#calendar-setup code { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
@media (max-width: 768px) {
    .app-header { position: sticky; top: 0; padding: .35rem .7rem; }
    .header-container { gap: .25rem; }
    .brand-logo { font-size: 1.15rem; }
    .brand-title { font-size: .8rem; line-height: 1.2; letter-spacing: 0; }
    .header-actions .btn { font-size: .6rem; padding: .3rem; min-height: 40px; }
    .vitals-container { grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; }
    .vital-box:nth-child(2), .rank-title { display: none; }
    .rank-badge { grid-column: auto; background: transparent; border: 0; padding: 0; }
    .vital-label { font-size: .6rem; }
    .hp-bar-bg { height: 5px; }
    .app-header.header-compact .vitals-container { display: none; }
}

