* {
    box-sizing: border-box;
}
:root {
    --bg: #1a1919;
    --text: #e6e6e6;
    --muted: #9a9a9a;
    --accent: #00ff9f;
    --danger: #ff5c5c;
    --info: #7ec0ff;
    --gold: #ffd166;
    font-size: 16px;
}

html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono",
        "Courier New", monospace;
}

#name {
    font-size: 25px;
}

.stat div:last-child {
    background-color: #272727;
    color: #d6d5d5;
    padding: 4px 15px;
    border-radius: 100px;
}

.stat div:first-child {
    padding: 4px 0px;
}

#hp {
    color: #5cff5c;
}

#atk {
    color: var(--danger);
}

#def {
    color: var(--info);
}

#gold {
    color: var(--gold);
}

.wrap {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 12px;
    height: 100vh;
    padding: 12px;
    box-sizing: border-box;
}

.console {
    background: #050505;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.console-inner {
    min-height: 0;
}

.line {
    white-space: pre-wrap;
    margin: 6px 0;
    line-height: 1.35;
}

.line .time {
    color: var(--muted);
    font-size: 0.85em;
    margin-right: 8px;
}

.line .sys {
    color: var(--muted);
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.action-btn {
    background: #3d3d3d;
    color: #fff;
    border: 2px solid #242424;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.02);
}

.action-btn:active {
    transform: translateY(1px);
}

.action-bucket {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hud {
    background: #070707;
    border-radius: 8px;
    padding: 12px;
    min-height: 500px;
    color: var(--muted);
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.03);
}

.stat:last-child {
    border-bottom: 0;
}

.small {
    font-size: 0.9em;
    color: var(--muted);
}

.color-accent {
    color: var(--accent);
}

.color-danger {
    color: var(--danger);
}

.color-info {
    color: var(--info);
}

.color-gold {
    color: var(--gold);
}

.choice {
    cursor: pointer;
}

.footer {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.hint {
    color: var(--muted);
    font-size: 0.9em;
}

.screen-controls {
    display: flex;
    gap: 6px;
}

/* scrollbar */
.console::-webkit-scrollbar {
    height: 12px;
    width: 10px;
}

.console::-webkit-scrollbar-thumb {
    background: #111;
    border-radius: 6px;
}

.big-btn {
    font-size: 1.2rem;
    padding: 1rem 2rem;
    margin-top: 1rem;
    background: #222;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 8px;
}

.big-btn:hover {
    background: #444;
}


/* ====== Responsive mejorado ====== */
@media (max-width: 900px) {
    .wrap {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        padding: 8px;
        gap: 8px;
    }

    .console {
        min-height: 400px;
        max-height: 60vh; /* no crece demasiado */
        scroll-behavior: smooth;
        padding: 10px;
    }

    .hud {
        order: 2;
        width: 100%;
        min-height: 500px;
        padding: 10px;
        font-size: 0.9rem;
    }

    .action-btn {
        flex: 1 1 100%; /* se adaptan al ancho */
        font-size: 0.9rem;
        padding: 8px;
    }

    .action-bucket {
        flex-direction: column;
    }

    .big-btn {
        width: 100%;
        font-size: 1rem;
        padding: 0.8rem 1rem;
        margin-top: 0.8rem;
    }

    .line {
        font-size: 0.95rem;
    }

    .footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Scrollbar más pequeña para móvil */
@media (max-width: 600px) {
    .console::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
}