/* ============================================
   CLAWGOTCHI — Red + White Pixel Art Theme
   ============================================ */

:root {
    --bg-dark: #0d0a0a;
    --bg-card: #1a1010;
    --bg-card-hover: #221414;
    --bg-input: #120c0c;
    --border: #3a1818;
    --border-accent: #cc2222;
    --red: #e03030;
    --red-bright: #ff4444;
    --red-dim: #882020;
    --white: #ffffff;
    --white-dim: #ccbbbb;
    --gray: #887777;
    --gray-dark: #554444;

    --good: #44cc66;
    --warn: #ddaa22;
    --danger: #ee6622;
    --critical: #ff2233;

    --color-buyback: #4488ff;
    --color-burn: #ff4444;
    --color-airdrop: #aa55ff;
    --color-treasury: #ffaa22;
    --color-hold: #888888;
    --color-claim: #44cc66;

    --font: 'Press Start 2P', monospace;
    --font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
}

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

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 8px;
    line-height: 1.5;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px;
}

/* ============================================
   HEADER
   ============================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-accent);
    margin-bottom: 8px;
}

.logo {
    font-size: 14px;
    color: var(--white);
    letter-spacing: 2px;
}
.logo-accent {
    color: var(--red-bright);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mc-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
}
.mc-label {
    color: var(--gray);
    font-size: 6px;
    letter-spacing: 1px;
}
.mc-value {
    color: var(--red-bright);
    font-size: 12px;
    font-family: var(--font-mono);
}

.ca-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color 0.2s;
}
.ca-badge:hover {
    border-color: var(--red);
}
.ca-label {
    color: var(--gray);
    font-size: 6px;
    letter-spacing: 1px;
}
.ca-value {
    color: var(--white-dim);
    font-size: 7px;
    font-family: var(--font-mono);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon {
    width: 14px;
    height: 14px;
    color: var(--red);
}

.twitter-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--white-dim);
    text-decoration: none;
    font-size: 7px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    background: var(--bg-dark);
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.twitter-link .icon {
    width: 10px;
    height: 10px;
    color: var(--white-dim);
}
.twitter-link:hover {
    color: var(--white);
    border-color: var(--red);
}
.twitter-link:hover .icon {
    color: var(--white);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.main {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    max-height: 70vh;
}

.col-left {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.col-right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ============================================
   PET CARD
   ============================================ */
.pet-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 12px;
    position: relative;
}

.pet-info-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 4px;
}

.age-tag {
    color: var(--gray);
    font-size: 7px;
    font-family: var(--font-mono);
}

.pet-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 360px;
    position: relative;
}

.tamagotchi-sprite {
    position: relative;
    width: 350px;
    height: 350px;
}

.sprite-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sprite-layer img {
    max-width: 320px;
    max-height: 320px;
    image-rendering: pixelated;
}

.body-layer {
    animation: bob 2s ease-in-out infinite;
}

.body-layer.bounce {
    animation: bounce 0.6s ease-out;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes bounce {
    0% { transform: translateY(0); }
    30% { transform: translateY(-12px); }
    100% { transform: translateY(0); }
}

/* Wants cloud */
.wants-cloud {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--white);
    color: var(--bg-dark);
    padding: 4px 8px;
    font-size: 7px;
    font-weight: bold;
    border: 2px solid var(--red);
    z-index: 10;
    white-space: pre-line;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}
.wants-cloud::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 12px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--red);
}

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

/* Pet Status: Mood + HP */
.pet-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0 4px;
}

.pet-mood {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mood-dot {
    width: 12px;
    height: 12px;
    background: var(--warn);
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.mood-name {
    font-size: 14px;
    color: var(--warn);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.pet-hp {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hp-label {
    font-size: 8px;
    color: var(--red);
    width: 24px;
    flex-shrink: 0;
    letter-spacing: 1px;
}

.hp-bar {
    flex: 1;
    height: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    overflow: hidden;
}

.hp-fill {
    height: 100%;
    width: 100%;
    background: var(--good);
    transition: width 0.4s ease, background-color 0.4s ease;
}

.hp-val {
    width: 32px;
    text-align: right;
    font-size: 8px;
    font-family: var(--font-mono);
    color: var(--good);
    flex-shrink: 0;
}

.last-action {
    margin-top: 6px;
    padding: 6px 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red-dim);
    font-size: 7px;
    color: var(--white-dim);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   STAT BARS
   ============================================ */
.stats-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    min-width: 80px;
    font-size: 7px;
    color: var(--white-dim);
    letter-spacing: 0.5px;
    flex-shrink: 0;
    text-align: left;
    display: flex;
    align-items: center;
}

.s-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    flex-shrink: 0;
}
.s-food { background: #ff6644; }
.s-mood { background: #ffcc44; }
.s-energy { background: #44aaff; }
.s-mc { background: #44cc66; }

.stat-bar-wrap {
    flex: 1;
}
.stat-bar {
    height: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    transition: width 0.4s ease, background-color 0.4s ease;
    width: 50%;
}

.stat-bar-fill.good { background: var(--good); }
.stat-bar-fill.warn { background: var(--warn); }
.stat-bar-fill.danger { background: var(--danger); }
.stat-bar-fill.critical { background: var(--critical); }

.stat-bar-fill.mc-bar {
    background: var(--red-bright);
    transition: width 0.4s ease, background-color 0.4s ease;
}

.stat-num {
    width: 28px;
    text-align: right;
    font-size: 7px;
    font-family: var(--font-mono);
    color: var(--white-dim);
    flex-shrink: 0;
}

/* ============================================
   AGENT METRICS
   ============================================ */
.metrics-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-top: 3px solid var(--gray);
}

.metric-rounds { border-top-color: var(--gray); }
.metric-fees { border-top-color: var(--good); }
.metric-buyback { border-top-color: var(--color-buyback); }
.metric-burned { border-top-color: var(--color-burn); }
.metric-airdrops { border-top-color: var(--color-airdrop); }

.metric-label {
    font-size: 6px;
    color: var(--white-dim);
    letter-spacing: 0.5px;
    text-align: center;
    text-transform: uppercase;
}

.metric-val {
    font-size: 9px;
    font-family: var(--font-mono);
    color: var(--white);
    text-align: center;
    word-break: break-all;
}

/* ============================================
   ACTIVITY PANEL (right column)
   ============================================ */
.activity-panel {
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.activity-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    background: var(--bg-card-hover);
}

.activity-title {
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--white);
    letter-spacing: 1px;
}

.settings-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--gray);
    cursor: pointer;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.settings-btn:hover {
    color: var(--red-bright);
    border-color: var(--red);
}

/* ============================================
   FEED
   ============================================ */
.feed-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}
.activity-panel .feed-scroll {
    flex: 1;
    overflow-y: auto;
}
.feed-scroll::-webkit-scrollbar { width: 4px; }
.feed-scroll::-webkit-scrollbar-track { background: var(--bg-dark); }
.feed-scroll::-webkit-scrollbar-thumb { background: var(--red-dim); border-radius: 2px; }

.feed-empty {
    color: var(--gray);
    font-size: 7px;
    text-align: center;
    padding: 20px 10px;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.status-dot.connected { background: var(--good); }
.status-dot.connecting { background: var(--warn); }
.status-dot.disconnected { background: var(--critical); }

/* ============================================
   ACTIVITY FEED CARDS (in feed scroll)
   ============================================ */
.activity-card {
    margin-bottom: 8px;
    padding: 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gray);
    transition: background 0.2s;
}
.activity-card:hover {
    background: var(--bg-card-hover);
}

.activity-card.action-BUYBACK,
.activity-card.action-BUYBACK_AND_BURN { border-left-color: var(--color-buyback); }
.activity-card.action-BURN { border-left-color: var(--color-burn); }
.activity-card.action-AIRDROP_SOL,
.activity-card.action-AIRDROP_TOKENS { border-left-color: var(--color-airdrop); }
.activity-card.action-TREASURY_SOL,
.activity-card.action-TREASURY_TOKENS { border-left-color: var(--color-treasury); }
.activity-card.action-HOLD { border-left-color: var(--color-hold); }
.activity-card.action-CLAIM_FEES { border-left-color: var(--color-claim); }

.activity-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.round-badge {
    font-size: 6px;
    color: var(--gray);
    font-family: var(--font-mono);
}
.round-num {
    color: var(--red-bright);
    font-size: 9px;
}

.decision-badge {
    padding: 1px 6px;
    font-size: 6px;
    font-family: var(--font);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 2px;
}
.decision-BUYBACK, .decision-BUYBACK_AND_BURN {
    background: rgba(68, 136, 255, 0.15);
    color: var(--color-buyback);
    border: 1px solid rgba(68, 136, 255, 0.3);
}
.decision-BURN {
    background: rgba(255, 68, 68, 0.15);
    color: var(--color-burn);
    border: 1px solid rgba(255, 68, 68, 0.3);
}
.decision-AIRDROP_SOL, .decision-AIRDROP_TOKENS {
    background: rgba(170, 85, 255, 0.15);
    color: var(--color-airdrop);
    border: 1px solid rgba(170, 85, 255, 0.3);
}
.decision-TREASURY_SOL, .decision-TREASURY_TOKENS {
    background: rgba(255, 170, 34, 0.15);
    color: var(--color-treasury);
    border: 1px solid rgba(255, 170, 34, 0.3);
}
.decision-HOLD {
    background: rgba(136, 136, 136, 0.15);
    color: var(--color-hold);
    border: 1px solid rgba(136, 136, 136, 0.3);
}
.decision-CLAIM_FEES {
    background: rgba(68, 204, 102, 0.15);
    color: var(--color-claim);
    border: 1px solid rgba(68, 204, 102, 0.3);
}

.activity-time {
    font-size: 6px;
    color: var(--gray-dark);
    font-family: var(--font-mono);
    margin-left: auto;
}

.activity-summary {
    font-size: 6px;
    color: var(--white-dim);
    margin-bottom: 4px;
    padding: 4px 6px;
    background: rgba(255,255,255,0.02);
}
.activity-summary .sol-val {
    color: var(--warn);
    font-family: var(--font-mono);
}
.activity-summary .tx-link {
    color: var(--red-dim);
    text-decoration: none;
    font-family: var(--font-mono);
}
.activity-summary .tx-link:hover {
    color: var(--red-bright);
}

.activity-reasoning {
    font-size: 6px;
    color: var(--gray);
    cursor: pointer;
    padding: 2px 0;
    user-select: none;
}
.activity-reasoning:hover {
    color: var(--white-dim);
}
.reasoning-toggle {
    color: var(--red-dim);
    margin-right: 4px;
}

.reasoning-full {
    display: none;
    margin-top: 4px;
    padding: 6px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 6px;
    color: var(--white-dim);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.reasoning-full.open {
    display: block;
}

/* ============================================
   CHAT SECTION
   ============================================ */
.chat-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 2px solid var(--border);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    background: var(--bg-card-hover);
    flex-wrap: wrap;
    gap: 8px;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-title {
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--white);
    letter-spacing: 1px;
}

.chat-cmds {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cmd-tag {
    padding: 2px 6px;
    background: var(--red-dim);
    border: 1px solid var(--red);
    color: var(--white);
    font-size: 6px;
    font-family: var(--font);
}

.cmd-divider {
    color: var(--gray-dark);
    font-size: 6px;
}

.cmd-keys {
    font-size: 6px;
    color: var(--gray);
}

.chat-scroll {
    max-height: 250px;
    flex: 1;
}

/* ============================================
   CHAT MESSAGES
   ============================================ */
.chat-msg {
    padding: 6px 10px;
    margin-bottom: 4px;
    font-size: 7px;
    border-left: 3px solid var(--border);
    background: var(--bg-dark);
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.chat-msg .chat-user {
    color: var(--red-bright);
    font-family: var(--font-mono);
    font-size: 7px;
    flex-shrink: 0;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-msg .chat-text {
    color: var(--white);
    flex: 1;
    word-break: break-word;
    font-size: 8px;
}
.chat-msg .chat-time {
    color: var(--gray-dark);
    font-size: 6px;
    font-family: var(--font-mono);
    flex-shrink: 0;
    white-space: nowrap;
}

/* Command messages */
.chat-msg.command {
    border-left-color: var(--red-bright);
    background: rgba(224, 48, 48, 0.08);
}
.chat-msg.command .chat-text {
    color: var(--red-bright);
    font-weight: bold;
    font-size: 9px;
    letter-spacing: 0.5px;
}

/* System messages */
.chat-msg.system {
    border-left-color: var(--gray);
    background: rgba(255, 255, 255, 0.02);
}
.chat-msg.system .chat-user {
    color: var(--gray);
}
.chat-msg.system .chat-text {
    color: var(--gray);
    font-style: italic;
}

/* ============================================
   SETTINGS
   ============================================ */
.setting-group label {
    display: block;
    font-size: 6px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.setting-row {
    display: flex;
    gap: 4px;
}

.setting-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 7px;
    padding: 4px 8px;
    outline: none;
}
.setting-input:focus {
    border-color: var(--red);
}
.setting-input::placeholder {
    color: var(--gray-dark);
}

.btn-sm {
    background: var(--red-dim);
    border: 1px solid var(--red);
    color: var(--white);
    font-family: var(--font);
    font-size: 6px;
    padding: 4px 10px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s;
    white-space: nowrap;
}
.btn-sm:hover {
    background: var(--red);
}

.commands-help {
    margin-top: 4px;
    font-size: 6px;
    color: var(--gray-dark);
    line-height: 1.8;
}

/* ============================================
   SETTINGS MODAL
   ============================================ */
.settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-content {
    background: var(--bg-card);
    border: 3px solid var(--border-accent);
    padding: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.modal-header h2 {
    font-size: 11px;
    color: var(--white);
    margin: 0;
    letter-spacing: 2px;
}

.modal-close {
    background: none;
    border: 1px solid var(--border);
    color: var(--red);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, border-color 0.2s;
}
.modal-close:hover {
    color: var(--red-bright);
    border-color: var(--red);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================
   HEADER INFO BUTTON
   ============================================ */
.header-btn {
    background: none;
    border: 2px solid var(--red);
    color: var(--red-bright);
    font-family: var(--font);
    font-size: 10px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.header-btn:hover {
    background: var(--red);
    color: var(--white);
}

/* ============================================
   INFO MODAL
   ============================================ */
.info-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}

.info-content {
    max-width: 650px;
    width: 95%;
    max-height: 85vh;
}

.info-body {
    gap: 16px !important;
}

.info-section {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.info-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-section h3 {
    font-size: 9px;
    color: var(--red-bright);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.info-section p {
    font-size: 7px;
    color: var(--white-dim);
    line-height: 2;
    margin-bottom: 6px;
}
.info-section p:last-child {
    margin-bottom: 0;
}

.hl {
    color: var(--white);
    background: var(--red-dim);
    padding: 1px 4px;
    border: 1px solid var(--red);
}

.info-table {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0;
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
}

.info-key {
    font-size: 6px;
    font-family: var(--font);
    min-width: 70px;
    flex-shrink: 0;
    padding: 2px 0;
    letter-spacing: 0.5px;
}

.info-val {
    font-size: 6px;
    color: var(--white-dim);
    line-height: 1.8;
}

.info-note {
    font-size: 6px !important;
    color: var(--gray) !important;
    font-style: italic;
    margin-top: 4px;
}

/* Info color classes */
.c-buyback { color: var(--color-buyback); }
.c-burn { color: var(--color-burn); }
.c-airdrop { color: var(--color-airdrop); }
.c-hold { color: var(--color-hold); }
.c-good { color: var(--good); }
.c-warn { color: var(--warn); }
.c-danger { color: var(--danger); }
.c-crit { color: var(--critical); }
.c-feed { color: #ff6644; }
.c-play { color: #ffcc44; }
.c-coke { color: #44aaff; }

/* ============================================
   WELCOME POPUP
   ============================================ */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: welcomeFadeIn 0.5s ease;
}

@keyframes welcomeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.welcome-box {
    text-align: center;
    max-width: 420px;
    padding: 40px 36px;
    border: 3px solid var(--red);
    background: var(--bg-card);
    box-shadow: 0 0 60px rgba(224, 48, 48, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.5);
    animation: welcomeSlideIn 0.6s ease;
}

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

.welcome-title {
    font-size: 22px;
    color: var(--white);
    letter-spacing: 3px;
    margin-bottom: 24px;
}

.welcome-text {
    font-size: 8px;
    color: var(--white-dim);
    line-height: 2.2;
    margin-bottom: 28px;
}

.welcome-hl {
    color: var(--red-bright);
    font-size: 9px;
}

.welcome-small {
    color: var(--gray);
    letter-spacing: 2px;
}

.welcome-btn {
    background: var(--red);
    border: 2px solid var(--white);
    color: var(--white);
    font-family: var(--font);
    font-size: 12px;
    padding: 10px 40px;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.2s;
}
.welcome-btn:hover {
    background: var(--red-bright);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

/* ============================================
   GAME OVER OVERLAY
   ============================================ */
.game-over-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.game-over-box {
    background: var(--bg-card);
    border: 3px solid var(--red-bright);
    padding: 30px 40px;
    text-align: center;
}

.game-over-title {
    font-size: 20px;
    color: var(--red-bright);
    margin-bottom: 12px;
    animation: flicker 1.5s infinite;
}

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

.game-over-msg {
    font-size: 8px;
    color: var(--white-dim);
    margin-bottom: 20px;
}

.btn-reset {
    background: var(--red);
    border: 2px solid var(--white);
    color: var(--white);
    font-family: var(--font);
    font-size: 10px;
    padding: 8px 24px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.2s;
}
.btn-reset:hover {
    background: var(--red-bright);
}

/* ============================================
   SNOW EFFECT
   ============================================ */
.snow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}
.flake {
    position: absolute;
    top: -20px;
    color: var(--white);
    font-size: 16px;
    animation: fall linear forwards;
    opacity: 0.8;
}
.flake:nth-child(1) { left: 10%; animation-duration: 2s; animation-delay: 0s; }
.flake:nth-child(2) { left: 30%; animation-duration: 2.5s; animation-delay: 0.3s; }
.flake:nth-child(3) { left: 50%; animation-duration: 1.8s; animation-delay: 0.1s; }
.flake:nth-child(4) { left: 70%; animation-duration: 2.2s; animation-delay: 0.5s; }
.flake:nth-child(5) { left: 90%; animation-duration: 2s; animation-delay: 0.2s; }

@keyframes fall {
    to { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .main { gap: 4px; }
    .col-left { flex: 0 0 55%; }
    .tamagotchi-sprite { width: 280px; height: 280px; }
    .sprite-layer img { max-width: 260px; max-height: 260px; }
    .pet-stage { min-height: 290px; }
}

@media (max-width: 768px) {
    .main { flex-direction: column; gap: 8px; }
    .col-left { flex: 0 0 auto; }
    .col-right { flex: 0 0 auto; min-height: 300px; }
    .chat-scroll { max-height: 200px; }
    .header { flex-wrap: wrap; gap: 8px; }
    .metrics-card { grid-template-columns: repeat(3, 1fr); }
    .modal-content { margin: 16px; max-width: 100%; }
    .tamagotchi-sprite { width: 250px; height: 250px; }
    .sprite-layer img { max-width: 230px; max-height: 230px; }
    .pet-stage { min-height: 260px; }
    .chat-cmds { display: none; }
}
