/* Dungeon Page Styles (Phase 2) */

#page-dungeon .dungeon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 4px 0 4px;
}
#page-dungeon .dungeon-title {
    font-size: 18px;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
#page-dungeon .dungeon-back-btn {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 11px;
    white-space: nowrap;
    min-width: auto;
}

.hp-bar {
    height: 14px;
    background: var(--surface-container-high);
    border: 1px solid var(--outline-color);
    border-radius: 10px;
    overflow: hidden;
}
.hp-bar .hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #d94c4c, #b81818);
    width: 0%;
    transition: width 0.3s ease;
}
html[data-theme='light'] .hp-bar .hp-fill {
    background: linear-gradient(90deg, #f36c6c, #e02b2b);
}

.hp-meta {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    font-size: 12px;
    opacity: 0.85;
    margin-top: 16px;
    margin-bottom: 8px;
}

.dungeon-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: calc(100vh - 76px);
}

.dungeon-scrollable-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 0 16px 0;
}

/* Wenn Inhalt nicht überläuft, kein Scrollbar anzeigen */
#page-dungeon .dungeon-scrollable-content:has(> :last-child) {
    overflow-y: auto;
}
.dungeon-monster-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0; /* direkt unter dem Header (App-Container hat bereits padding-top) */
    z-index: 1; /* nicht über nächste Cards legen */
}

.monster-card-header {
    text-align: left;
    margin-bottom: 0;
}

.monster-name {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.monster-card-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: center;
}

.monster-image-section {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /* Entfernt jeglichen Hintergrund damit PNG transparent bleibt */
}

.monster-image {
    width: min(48vw, 192px); /* ~20% größer */
    height: min(48vw, 192px);
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.15));
    transition: transform 180ms ease, filter 180ms ease;
    animation: monsterIdle 3s ease-in-out infinite;
    background: transparent;
    /* Reduziere Schatten für sauberere PNG-Darstellung */
}

.monster-stats-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.monster-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.monster-stat .stat-label {
    font-size: 12px;
    color: var(--on-surface-color);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.monster-stat .stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--on-surface-color);
}

.monster-hp-section {
    margin-top: 0;
}

.dungeon-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.dungeon-actions .card { margin: 0; }
.dungeon-actions .exercise-card { position: relative; z-index: 0; }
.dungeon-actions .exercise-card-actions { display: flex; gap: 8px; }
.dungeon-actions .reps-input {
    width: 64px;
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid var(--outline-color);
    background: var(--surface-container-high);
    color: var(--on-surface-color);
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
    /* appearance: textfield; */ /* Firefox - Entfernt um Pfeile zu zeigen */
}

.dungeon-actions .reps-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.2);
}

/* Style die Browser-Spinner für Dark/Light Mode */
/* Dark Mode: Nutze color-scheme für native dunkle Pfeile */
html[data-theme='dark'] .dungeon-actions .reps-input {
    color-scheme: dark;
}

/* Light Mode: Nutze color-scheme für native helle Pfeile */
html[data-theme='light'] .dungeon-actions .reps-input {
    background: var(--surface-color);
    color: var(--on-surface-color);
    color-scheme: light;
}

/* Force dark look on autofill/background */
html[data-theme='dark'] .dungeon-actions .reps-input,
html[data-theme='dark'] .dungeon-actions .reps-input:-webkit-autofill,
html[data-theme='dark'] input.reps-input,
html[data-theme='dark'] input[type=number].reps-input {
    -webkit-text-fill-color: var(--on-surface-color);
    -webkit-box-shadow: 0 0 0 30px var(--surface-container-high) inset !important;
    box-shadow: 0 0 0 30px var(--surface-container-high) inset !important;
}

html[data-theme='light'] .dungeon-actions .reps-input:-webkit-autofill {
    -webkit-text-fill-color: var(--on-surface-color);
    -webkit-box-shadow: 0 0 0 30px var(--surface-color) inset !important;
}

.dungeon-player-status {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 16px;
    align-items: center;
}
.stat-chip {
    background: var(--surface-container-high);
    border: 1px solid var(--outline-color);
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 13px;
}

/* Monster idle/breathing animation */
@keyframes monsterIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Monster hit and counter animations - verlangsamt */
@keyframes monsterHitFlash {
    0% { filter: drop-shadow(0 0 0 rgba(255,0,0,0.0)); }
    30% { filter: drop-shadow(0 0 20px rgba(255,0,0,0.7)); }
    100% { filter: drop-shadow(0 0 0 rgba(255,0,0,0.0)); }
}
.monster-hit { 
    animation: monsterHitFlash 600ms ease, monsterIdle 3s ease-in-out infinite; 
}

@keyframes monsterPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.08); }
    100% { transform: scale(1); }
}
.monster-pulse { 
    animation: monsterPulse 450ms ease, monsterIdle 3s ease-in-out infinite; 
}

/* Screen edge red vignette */
.screen-damage-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 250ms ease;
    background: radial-gradient(100% 120% at 0% 50%, rgba(255,0,0,0.3), rgba(255,0,0,0) 60%),
                radial-gradient(100% 120% at 100% 50%, rgba(255,0,0,0.3), rgba(255,0,0,0) 60%);
}
.screen-damage-overlay.active { opacity: 1; }

