﻿:root {
    --cor-fundo: #ffede0;
    --cor-laranja: #ff8c42;
    --cor-laranja-escuro: #e07b39;
    --cor-texto: #333;
    --cor-hp: #d9534f;
    --cor-energia: #5bc0de;
    --cor-adrenalina: #f0ad4e;
    --cor-borda: #ccc;
    --cor-defesa: #888;
}

body.theme-coliseu {
    --cor-laranja: #ff8c42;
    --cor-laranja-escuro: #e07b39;
}

body.theme-aquatico {
    --cor-laranja: #1e88e5;
    --cor-laranja-escuro: #1565c0;
}

body.theme-roma {
    --cor-laranja: #9aa0a6;
    --cor-laranja-escuro: #6f757a;
}

body.night-mode {
    --cor-fundo: #000;
    --cor-texto: #e0e0e0;
    --cor-borda: #333;
    background: #000;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background: linear-gradient(180deg, #ffb74d, #ff9800);
    color: var(--cor-texto);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    transition: background 0.3s, color 0.3s;
}

body.theme-aquatico { background: linear-gradient(180deg, #64b5f6, #1e88e5); }
body.theme-roma { background: linear-gradient(180deg, #f5f5f5, #bdbdbd); }
body.theme-coliseu { background: linear-gradient(180deg, #ffb74d, #ff9800); }
body.night-mode { background: #000; }

.game-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--cor-fundo);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 95vh;
    max-height: 95vh;
    transition: background-color 0.3s;
}

.layout-switch { display: flex; justify-content: center; gap: 4px; padding: 8px; }
.layout-option { border: 1px solid var(--cor-borda); border-radius: 6px; padding: 6px 12px; color: var(--cor-texto); background: transparent; cursor: pointer; }
.layout-option[aria-pressed="true"] { background: var(--cor-laranja-escuro); color: white; }
body.pc-mode .game-container { max-width: min(1200px, 96vw); }

.screen {
    padding: 20px;
    box-sizing: border-box;
    display: none !important;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}
.screen.active { display: flex !important; }

h1, h2, h3 { color: var(--cor-laranja-escuro); margin-top: 0; }

#start-screen { justify-content: center; }
.game-title { font-size: 2.5em; font-weight: bold; margin-bottom: 20px; }

.btn {
    background-color: var(--cor-laranja); color: white; border: none;
    padding: 15px 30px; border-radius: 8px; font-size: 1.2em;
    cursor: pointer; margin: 5px; transition: 0.2s; min-width: 200px;
}
.btn:hover { background-color: var(--cor-laranja-escuro); }
.btn:active { transform: scale(0.98); }
.btn:disabled { background-color: #888; cursor: not-allowed; }

.btn-delete { background-color: #a9a9a9; }
.btn-delete:hover { background-color: #8b8b8b; }
.btn-night { background-color: #333; }

.history-panel, .achievements-panel {
    width: 90%; background: rgba(0,0,0,0.1); border-radius: 8px;
    padding: 10px; margin-top: 15px; text-align: left; max-height: 150px; overflow-y: auto;
    font-size: 0.9em;
}

.input-group { margin: 10px 0; width: 100%; }
.input-group select { width: 85%; padding: 10px; font-size: 1.1em; }
input[type="text"] { width: 80%; padding: 10px; font-size: 1.1em; border-radius: 5px; border: 1px solid var(--cor-borda); }
.emoji-selector { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.emoji-btn { font-size: 2em; padding: 5px; border: 2px solid transparent; border-radius: 50%; cursor: pointer; background: none; }
.emoji-btn.selected { border-color: var(--cor-laranja); background-color: rgba(255,140,66,0.2); }
.emoji-btn.locked, .emoji-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.6); }
.enemy-skill { font-size: 0.9em; font-weight: bold; color: var(--cor-laranja-escuro); margin: 4px 0; }
.toast { position: fixed; top: 16px; right: 16px; background: rgba(0,0,0,0.85); color: #fff; padding: 10px 14px; border-radius: 8px; z-index: 9999; font-size: 0.95em; opacity: 1; transition: opacity 0.3s ease; max-width: 280px; }
.toast-hide { opacity: 0; }
.toast-hide { opacity: 0; }

.battle-area { width: 100%; display: flex; flex-direction: column; justify-content: space-between; flex-grow: 1; }
.character-display { border: 2px solid var(--cor-borda); border-radius: 10px; padding: 10px; margin: 5px auto; background-color: rgba(255,255,255,0.1); width: 90%; position: relative; }
.character-name { font-weight: bold; font-size: 1.2em; margin-bottom: 5px; }
.character-art { font-size: 3.5em; margin: 5px 0; line-height: 1; transition: transform 0.1s; }
.hit-anim { transform: scale(1.2) rotate(5deg); color: red; }

.stat-bars { width: 100%; }
.stat-bar { width: 100%; background-color: rgba(0,0,0,0.2); border-radius: 20px; margin: 5px 0; position: relative; height: 25px; overflow: hidden; border: 1px solid var(--cor-borda); }
.stat-bar > div { height: 100%; border-radius: 20px; transition: width 0.1s linear; text-align: right; padding-right: 5px; color: white; font-weight: bold; font-size: 0.9em; line-height: 25px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.bar-label { position: absolute; left: 10px; top: 0; line-height: 25px; color: var(--cor-texto); font-weight: bold; font-size: 0.9em; z-index: 2; }

#hp-bar-fill, #enemy-hp-bar-fill { background-color: var(--cor-hp); }
#energy-bar-fill { background-color: var(--cor-energia); }
#adrenaline-bar-fill { background-color: var(--cor-adrenalina); }

.status-effects { display: flex; justify-content: center; gap: 5px; height: 20px; margin-top: 5px; font-size: 0.9em; color: red; font-weight: bold; }
.defending { border-color: var(--cor-defesa) !important; box-shadow: 0 0 10px var(--cor-defesa); }

.action-panel { margin-top: 10px; width: 100%; }
.action-buttons { display: flex; justify-content: space-around; gap: 10px; }
.action-buttons .btn { flex-grow: 1; padding: 15px; font-weight: bold; }

.consumable-slots { display: flex; justify-content: center; gap: 5px; margin-top: 10px; flex-wrap: wrap; }
.slot { width: 45px; height: 45px; border: 2px dashed var(--cor-borda); border-radius: 8px; display: flex; justify-content: center; align-items: center; font-size: 1.5em; cursor: pointer; background-color: rgba(255,255,255,0.1); position: relative; }
.slot:hover { border-color: var(--cor-laranja-escuro); }

.log-message { margin-top: 5px; font-style: italic; font-size: 0.9em; height: 1.2em; color: var(--cor-texto); font-weight: bold; }

.money-display { font-size: 1.5em; font-weight: bold; color: #e69100; margin-bottom: 15px; }
.shop-category { width: 100%; margin-bottom: 15px; border: 1px solid var(--cor-borda); border-radius: 8px; padding: 10px; box-sizing: border-box; }
.shop-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,0.1); text-align: left; }
.shop-item-info { width: 70%; }
.item-name { font-size: 1.1em; font-weight: bold; }
.item-desc { font-size: 0.8em; opacity: 0.8; }
.btn-buy { padding: 8px; font-size: 0.9em; min-width: 80px; margin: 0; }

#game-over-screen h1 { color: var(--cor-hp); }
.stats-summary { text-align: left; margin: 20px 0; background: rgba(0,0,0,0.1); padding: 15px; border-radius: 10px; }

.card-hand { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; }
.battle-card { position: relative; min-height: 110px; padding: 8px; border: 2px solid var(--cor-borda); border-radius: 8px; background: rgba(255,255,255,0.7); color: var(--cor-texto); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.battle-card:disabled { opacity: 0.55; cursor: not-allowed; }
.battle-card.rarity-normal, .shop-card-preview.rarity-normal { border-color: #a65f3e; }
.battle-card.rarity-rare, .shop-card-preview.rarity-rare { border-color: #c6ccd2; box-shadow: inset 0 0 0 1px #edf0f2; }
.battle-card.rarity-gold, .shop-card-preview.rarity-gold { border: 2px solid #d4aa32; box-shadow: inset 0 0 0 1px #f4df9b, 0 0 9px rgba(212,170,50,0.35); }
.card-symbol { font-size: 1.5em; }
.card-cost { font-weight: bold; }
.shop-card-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 76px; padding: 6px; border: 2px solid var(--cor-borda); border-radius: 6px; }
.passive-tooltip { cursor: help; border-bottom: 1px dotted currentColor; }
.path-choices { display: grid; grid-template-columns: 1fr; gap: 10px; width: 100%; }
.path-choice, .boss-path-choice { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; }
.room-trail { display: block; width: 100%; margin: 8px 0; }
.trail-rooms { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px; }
.trail-boss-row { display: flex; justify-content: center; margin-top: 10px; }
.trail-node { display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.75em; min-width: 28px; }
.boss-node { width: auto; min-width: 120px; max-width: 220px; min-height: 56px; align-items: center; justify-content: center; border: 2px solid #d4aa32; border-radius: 8px; background: linear-gradient(145deg, #fff1bd, #e0b52f); color: #382600; box-shadow: 0 0 14px rgba(212,170,50,0.55); transform: scale(1.05); padding: 6px 10px; }
.boss-node strong { font-size: 1.8em; }
.boss-node small { display: block; margin-top: 2px; font-weight: 700; text-align: center; word-break: break-word; }
.boss-node.completed { background: linear-gradient(145deg, #f8d76b, #b57808); }
.empty-card { opacity: 0.5; }
#enemy-intent, #enemy-weaknesses, #player-shield, #enemy-shield, #active-passives, #deck-count { margin: 4px 0; font-size: 0.9em; }
.double-attack-intent { color: #a12616; font-weight: 800; animation: intent-strike 0.7s ease-in-out infinite alternate; }

@keyframes player-strike { 0%, 100% { transform: translateX(0); } 45% { transform: translateX(12px) scale(1.04); } }
@keyframes special-strike { 0%, 100% { transform: translateX(0) scale(1); } 35% { transform: translateX(16px) scale(1.1); filter: brightness(1.5); } 65% { transform: translateX(-3px) scale(0.98); } }
@keyframes damage-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes double-windup { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 12px #fa4b32); transform: scale(1.04); } }
@keyframes intent-strike { to { text-shadow: 0 0 8px #f0ad4e; } }
.player-attack { animation: player-strike 0.35s ease-out; }
.special-attack { animation: special-strike 0.5s ease-out; }
.damage-flash { animation: damage-shake 0.3s ease-in-out; }
.double-attack-windup { animation: double-windup 0.65s ease-in-out; }
.combat-effect.special-attack { color: #b51e12; font-weight: 900; }

@media (min-width: 700px) {
    .path-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-hand { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    body.pc-mode #battle-screen .battle-area { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "enemy player" "log log" "actions actions"; align-items: start; gap: 12px; }
    body.pc-mode #enemy-display { grid-area: enemy; }
    body.pc-mode #player-display { grid-area: player; }
    body.pc-mode #log-message { grid-area: log; }
    body.pc-mode #battle-screen .action-panel { grid-area: actions; }
}
.shop-tabs { display: flex; gap: 6px; margin: 8px 0; }
.shop-tab { flex: 1; padding: 8px; border: 1px solid var(--cor-borda); border-radius: 6px; background: transparent; color: var(--cor-texto); cursor: pointer; }
.shop-tab.active { background: var(--cor-laranja-escuro); color: #fff; }
.shop-reroll-row { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; justify-content: center; }
.btn-small { min-width: auto; padding: 8px 12px; font-size: 0.9em; }
.shop-tab:active, .shop-tab:focus { background: var(--cor-laranja); color: #fff; }
.btn-buy:active, .btn-buy:focus { background-color: var(--cor-laranja-escuro); color: #fff; }
.btn-small:active, .btn-small:focus { background-color: var(--cor-laranja-escuro); color: #fff; }
#active-passives { font-size: 0.85em; padding: 4px 6px; background: rgba(0,0,0,0.08); border-radius: 6px; }
.debuff-icon { display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border-radius: 10px; background: rgba(0,0,0,0.15); font-size: 0.85em; font-weight: bold; }
.btn { box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.25); }
.character-display { transition: box-shadow 0.2s, transform 0.2s; }
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; width: 100%; margin: 10px 0; }
.inventory-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; border: 2px solid var(--cor-borda); border-radius: 8px; background: var(--cor-fundo); }
.inventory-qty { font-weight: bold; font-size: 0.9em; }
.passive-tooltip { cursor: help; }