/* ===================================
   DARK GAME PALETTE
   =================================== */
:root {
    --game-bg:       #0d0d14;
    --panel:         #14141e;
    --panel-hi:      #1c1c2a;
    --panel-raised:  #232334;
    --border:        rgba(255,255,255,0.08);
    --border-mid:    rgba(255,255,255,0.14);
    --border-strong: rgba(255,255,255,0.22);
    --brand:         #0057B8;
    --brand-hi:      #1a6fcc;
    --gold:          #F9A825;
    --accent:        #C62828;
    --text:          #f0f0f0;
    --text-mid:      rgba(240,240,240,0.68);
    --text-dim:      rgba(240,240,240,0.38);
}

/* ===================================
   RESET & BASE
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: var(--game-bg);
    color: var(--text);
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

/* ===================================
   SETUP & GAME OVER — shared shell
   =================================== */
.setup-screen,
.game-over {
    background: var(--panel);
    border: 1px solid var(--border-mid);
    border-radius: 12px;
    padding: 40px;
    max-width: 840px;
    margin: 0 auto 40px;
}

/* ===================================
   GAME TITLE (setup screen)
   =================================== */
.game-title-block {
    margin-bottom: 36px;
    text-align: center;
}

.game-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(3rem, 8vw, 5.5rem);
    letter-spacing: 0.06em;
    line-height: 1;
    color: var(--text);
    margin-bottom: 6px;
}

.game-title span {
    color: var(--gold);
}

.game-tagline {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--text-dim);
}

.game-intro {
    font-size: 0.88rem;
    line-height: 1.75;
    color: var(--text-mid);
    margin: 20px 0 0;
    text-align: center;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.conditions-note {
    font-size: 0.75rem;
    line-height: 1.65;
    color: var(--text-dim);
    margin-bottom: 12px;
    font-style: italic;
    border-left: 2px solid var(--border-mid);
    padding-left: 12px;
}

/* ===================================
   SECTION LABELS (setup)
   =================================== */
.section-label {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-dim);
    margin-bottom: 10px;
    margin-top: 28px;
}

/* ===================================
   THEME SELECTOR
   =================================== */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.theme-selector label { font-weight: 700; }

.theme-selector select {
    background: var(--panel-hi);
    border: 1px solid var(--border-strong);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
}

/* ===================================
   MODE BUTTONS
   =================================== */
.mode-select {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 4px;
}

.mode-btn {
    background: var(--panel-hi);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    padding: 18px 14px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    text-align: center;
    color: var(--text);
    font-family: 'Roboto', sans-serif;
}

.mode-btn h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.92rem;
    margin-bottom: 5px;
    color: var(--text);
    letter-spacing: 0.01em;
}

.mode-btn p {
    font-size: 0.73rem;
    color: var(--text-dim);
    line-height: 1.4;
}

.mode-btn:hover:not(.selected) {
    border-color: var(--brand);
    transform: translateY(-2px);
}

.mode-btn.selected {
    border-color: var(--brand);
    background: rgba(0,87,184,0.12);
    box-shadow: 0 4px 0 var(--brand), 0 8px 20px rgba(0,87,184,0.18);
    transform: translateY(-2px);
}

.mode-btn.selected h3 { color: #fff; }

/* ===================================
   CONDITION CARDS
   =================================== */
.condition-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 4px;
}

.condition-option {
    --cond-color: #78909c;
    background: var(--panel-hi);
    border: 1px solid var(--border);
    border-left: 3px solid var(--cond-color);
    border-radius: 8px;
    padding: 14px 14px 14px 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.1s;
    text-align: left;
}

.condition-option:hover:not(.selected) {
    border-color: var(--cond-color);
    background: var(--panel-raised);
    transform: translateY(-2px);
}

.condition-option.selected {
    border-color: var(--cond-color);
    background: var(--panel-raised);
    box-shadow: 0 4px 0 var(--cond-color), 0 8px 20px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

/* Condition accent colors */
.cond-neurotypical { --cond-color: #78909c; }
.cond-depression   { --cond-color: #5c6bc0; }
.cond-adhd         { --cond-color: #0057B8; }
.cond-anxiety      { --cond-color: #00838F; }
.cond-asd          { --cond-color: #E65100; }
.cond-ocd          { --cond-color: #2E7D32; }
.cond-bipolar      { --cond-color: #6A1B9A; }
.cond-ptsd         { --cond-color: #C62828; }

.condition-option h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.88rem;
    color: var(--cond-color);
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}

.condition-penalty {
    font-size: 0.72rem;
    color: rgba(255,140,120,0.85);
    line-height: 1.4;
    margin-bottom: 4px;
}

.condition-positive {
    font-size: 0.72rem;
    color: rgba(140,220,160,0.85);
    line-height: 1.4;
}

/* ===================================
   RULES BLOCK (setup)
   =================================== */
.rules {
    background: var(--panel-hi);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 0.82rem;
    line-height: 1.65;
    text-align: left;
    color: var(--text-mid);
    margin-top: 28px;
}

.rules h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.rules ul {
    margin-left: 18px;
    margin-top: 4px;
}

.rules li {
    margin-bottom: 6px;
}

.copyright {
    margin-top: 24px;
    font-size: 0.68rem;
    color: var(--text-dim);
    text-align: center;
}

/* ===================================
   GAME OVER SCREEN
   =================================== */
.game-over {
    text-align: center;
    border-color: var(--gold);
    box-shadow: 0 0 0 1px rgba(249,168,37,0.15), 0 12px 40px rgba(0,0,0,0.5);
}

.game-over.burnout {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(198,40,40,0.25), 0 12px 40px rgba(0,0,0,0.5);
}

.game-over-title {
    font-family: 'Bangers', cursive;
    font-size: clamp(2.8rem, 8vw, 5rem);
    letter-spacing: 0.06em;
    line-height: 1;
    margin-bottom: 16px;
    color: var(--gold);
}

.game-over.burnout .game-over-title {
    color: var(--accent);
}

.game-over p {
    color: var(--text-mid);
    line-height: 1.6;
    margin-top: 12px;
}

/* ===================================
   GAME HUD HEADER
   =================================== */
.header {
    background: var(--panel);
    border: 1px solid var(--border-mid);
    border-bottom: 3px solid var(--brand);
    border-radius: 8px;
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.header h1 {
    font-family: 'Bangers', cursive;
    font-size: 1.75rem;
    letter-spacing: 0.05em;
    line-height: 1;
    color: var(--text);
    margin: 0;
}

.stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stat {
    background: var(--panel-hi);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.78rem;
    color: var(--text-mid);
}

.stat strong {
    color: var(--text);
}

.stat.stress-warning strong { color: #ff9800; }
.stat.stress-danger  strong { color: var(--accent); }

.stress-warning { color: #ff9800; }
.stress-danger  { color: var(--accent); }

/* Burnout */
.header.burnt-out {
    border-bottom-color: var(--accent);
    background: rgba(198,40,40,0.07);
}

.header.burnt-out h1 {
    color: var(--accent);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* ===================================
   GAME AREA LAYOUT
   =================================== */
.game-area {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-bottom: 16px;
}

.section {
    background: var(--panel);
    border: 1px solid var(--border-mid);
    border-radius: 8px;
    padding: 16px;
}

.section h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-dim);
    margin-bottom: 14px;
}

.section h2.stress-warning { color: #ff9800; }
.section h2.stress-danger  { color: var(--accent); }

/* ===================================
   CARD BASE
   =================================== */
.card {
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    background: var(--panel-hi);
    overflow: hidden;
    position: relative;
}

.card:hover:not(.selected) {
    border-color: rgba(255,255,255,0.32);
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.card.selected {
    border-color: var(--brand);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 4px 0 var(--brand), 0 8px 24px rgba(0,87,184,0.28);
}

/* ===================================
   TASK CARDS — time-of-day color system
   =================================== */
.t-morning   { --time-color: #e67e22; }
.t-midday    { --time-color: #3498db; }
.t-afternoon { --time-color: #e74c3c; }
.t-evening   { --time-color: #6c3483; }

.task-card {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
}

.task-card .time-stripe {
    height: 5px;
    background: var(--time-color, #555);
    flex-shrink: 0;
}

.task-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    min-height: 0;
}

.task-card .card-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 13px;
    color: var(--text);
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.task-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-cost { display: flex; gap: 4px; flex-wrap: wrap; }

.cost-pip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px 2px 4px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.cost-pip.physical { background: rgba(192,57,43,0.2);  color: #e88; border: 1px solid rgba(192,57,43,0.35); }
.cost-pip.social   { background: rgba(52,152,219,0.15); color: #8bc; border: 1px solid rgba(52,152,219,0.3);  }
.cost-pip.mental   { background: rgba(230,126,34,0.15); color: #ca9; border: 1px solid rgba(230,126,34,0.3);  }
.cost-pip.base-cost { opacity: 0.4; text-decoration: line-through; }

.time-badge {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--time-color, #888);
    border: 1px solid var(--time-color, #888);
    padding: 1px 5px;
    border-radius: 3px;
    opacity: 0.75;
    white-space: nowrap;
}

.task-card .divider {
    height: 1px;
    background: var(--border);
    margin: 0 0 8px;
}

.task-card .card-flavor {
    flex: 1;
    font-style: italic;
    font-size: 10px;
    color: var(--text-dim);
    line-height: 1.4;
    text-align: center;
    padding: 2px;
}

.task-card .card-effect {
    padding: 7px 12px;
    font-size: 10px;
    font-weight: 700;
    color: white;
    text-align: center;
    line-height: 1.3;
    background: var(--time-color, #555);
    flex-shrink: 0;
    margin-top: auto;
}

/* ===================================
   TASK CARD AREA
   =================================== */
.task-card-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* ===================================
   F-CARDS
   =================================== */
.f-card-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.f-card {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.f-card .f-stripe {
    height: 5px;
    flex-shrink: 0;
}

.f-card .f-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    gap: 5px;
}

.f-card .f-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.f-card .f-icon { font-size: 20px; line-height: 1; }

.f-card .f-type {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 7px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.f-card.physical .f-stripe    { background: #e74c3c; }
.f-card.physical .f-icon-wrap { background: rgba(231,76,60,0.15); }
.f-card.physical .f-type      { color: #e88; }

.f-card.social .f-stripe    { background: #3498db; }
.f-card.social .f-icon-wrap { background: rgba(52,152,219,0.15); }
.f-card.social .f-type      { color: #8bc; }

.f-card.mental .f-stripe    { background: #e67e22; }
.f-card.mental .f-icon-wrap { background: rgba(230,126,34,0.15); }
.f-card.mental .f-type      { color: #ca9; }

/* ===================================
   BUTTONS
   =================================== */
.buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

button {
    background: var(--brand);
    color: white;
    border: none;
    padding: 11px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    transition: filter 0.15s, opacity 0.15s;
    white-space: nowrap;
}

button:hover:not(:disabled) { filter: brightness(1.15); }
button:disabled              { opacity: 0.3; cursor: not-allowed; }

button.secondary {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-mid);
}

button.secondary:hover:not(:disabled) {
    border-color: rgba(255,255,255,0.5);
    color: var(--text);
    filter: none;
}

.ability-btn {
    background: transparent;
    border: 1px solid #546E7A;
    color: #90a4ae;
}

.ability-btn:hover:not(:disabled) {
    border-color: #90a4ae;
    color: var(--text);
    filter: none;
}

/* ===================================
   MESSAGES
   =================================== */
.message {
    background: rgba(0,87,184,0.1);
    border: 1px solid rgba(0,87,184,0.35);
    border-left: 3px solid var(--brand);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 0.83rem;
    line-height: 1.55;
    color: var(--text-mid);
}

.message.error {
    background: rgba(198,40,40,0.1);
    border-color: rgba(198,40,40,0.35);
    border-left-color: var(--accent);
}

.message.warning {
    background: rgba(249,168,37,0.07);
    border-color: rgba(249,168,37,0.3);
    border-left-color: var(--gold);
}

/* ===================================
   COMPLETED TASKS
   =================================== */
.completed-task {
    background: rgba(249,168,37,0.05);
    border: 1px solid rgba(249,168,37,0.18);
    padding: 6px 10px;
    margin-bottom: 4px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-mid);
}

.completed-tasks.warning .completed-task {
    background: rgba(255,152,0,0.07);
    border-color: rgba(255,152,0,0.28);
    color: #ff9800;
}

.completed-tasks.danger .completed-task {
    background: rgba(198,40,40,0.07);
    border-color: rgba(198,40,40,0.28);
    color: #ef9a9a;
}

/* ===================================
   LINGERING TASKS
   =================================== */
.lingering-tasks-area {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: rgba(0,0,0,0.2);
    padding: 8px 10px;
    border-radius: 6px;
    margin: 12px 0 8px;
    border: 1px solid var(--border);
}

.lingering-deck { flex: 1; min-width: 0; }

.lingering-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-card-pile {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    min-height: 10px;
    justify-content: center;
}

.mini-task-card {
    width: 14px;
    height: 9px;
    border-radius: 2px;
    background: #555;
}

.mini-task-card.morning   { background: #e67e22; }
.mini-task-card.midday    { background: #3498db; }
.mini-task-card.afternoon { background: #e74c3c; }
.mini-task-card.evening   { background: #6c3483; }

/* ===================================
   RULES REMINDER (in-game)
   =================================== */
.rules-reminder {
    background: rgba(249,168,37,0.05);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    padding: 10px 12px 10px 14px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 0.74rem;
    color: var(--text-mid);
    line-height: 1.55;
}

.rules-reminder ul     { list-style-position: inside; padding-left: 4px; }
.rules-reminder li     { margin-bottom: 4px; }
.rules-reminder li:last-child { margin-bottom: 0; }
.rules-reminder strong { color: var(--gold); font-weight: 700; }

/* ===================================
   CONDITION REMINDERS (in-game sidebar)
   =================================== */
.condition-reminders { margin-bottom: 14px; }

.condition-reminder {
    background: var(--panel-hi);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.condition-reminder h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: 0.73rem;
    color: var(--text);
    margin-bottom: 3px;
}

.condition-reminder p {
    font-size: 0.7rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* ===================================
   BIPOLAR EPISODE BANNER
   =================================== */
.bipolar-banner {
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: 0.03em;
}

.bipolar-banner.manic {
    background: rgba(249,168,37,0.07);
    border: 1px solid rgba(249,168,37,0.38);
    color: #ffd54f;
}

.bipolar-banner.depressive {
    background: rgba(92,107,192,0.09);
    border: 1px solid rgba(92,107,192,0.38);
    color: #9fa8da;
}

/* ===================================
   OCD BONUS NOTE
   =================================== */
.ocd-bonus-note {
    background: rgba(46,125,50,0.09);
    border: 1px solid rgba(46,125,50,0.38);
    color: #a5d6a7;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    margin-bottom: 12px;
    text-align: center;
}

/* ===================================
   STRESS SHIELD BADGE
   =================================== */
.shield-badge {
    display: inline-block;
    background: rgba(21,101,192,0.28);
    color: #90caf9;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 11px;
    margin-left: 4px;
    border: 1px solid rgba(21,101,192,0.45);
}

/* ===================================
   FOOTER
   =================================== */
.footer-note {
    text-align: center;
    margin-top: 30px;
    font-size: 0.7rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ===================================
   FEEDBACK SECTION
   =================================== */
.feedback-section {
    background: var(--panel);
    padding: 40px 20px;
    margin-top: 40px;
    border-radius: 8px;
    text-align: center;
}

.feedback-section h2 {
    color: var(--gold);
    margin-bottom: 20px;
}

.feedback-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--panel-hi);
    border-radius: 8px;
    overflow: hidden;
    min-height: 1500px;
}

.feedback-container iframe {
    width: 100%;
    min-height: 1500px;
    border: none;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 900px) {
    .game-area { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    body { padding: 10px; }

    .setup-screen,
    .game-over { padding: 24px 16px; }

    .game-title { font-size: 2.8rem; }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .header h1 { font-size: 1.4rem; }

    .mode-select { grid-template-columns: 1fr; }

    .condition-select { grid-template-columns: 1fr; }

    .buttons { flex-direction: column; }
    button   { width: 100%; }

    .f-card-area {
        grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
        gap: 6px;
    }

    .lingering-tasks-area { flex-wrap: wrap; }
    .lingering-deck       { flex-basis: 45%; }
}
