/* ============================================
   GOLDFISH MODE - PREMIUM THEME
   Playtesting interface styles
   ============================================ */

/* All zone icons use the theme accent color */
.goldfish-modal .zone-icon {
    color: var(--accent-color);
}

/* Modal Overlay - Full screen with blur */
.goldfish-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

/* Main Modal Container */
.goldfish-modal {
    width: 95vw;
    height: 95vh;
    background: var(--bg-gradient);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
    position: relative;
}

/* Header */
.goldfish-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 10px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
}

.goldfish-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.goldfish-title-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-color);
    text-transform: uppercase;
}

.goldfish-deck-name {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
}

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

.goldfish-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goldfish-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ef4444;
}

/* Stats Section */
.goldfish-stats-section {
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.goldfish-stats-bar {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-quick-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s;
}

.stat-item:hover {
    border-color: var(--accent-glow);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.1rem;
}

.stat-value.turn-value {
    color: var(--accent-color);
    font-size: 1.25rem;
}

.next-turn-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.next-turn-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* HP Bar */
.goldfish-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.goldfish-label {
    font-weight: 600;
    color: #eab308;
    /* Yellow-500 */
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goldfish-hp-bar {
    width: 300px;
    height: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.goldfish-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #facc15 50%, #4ade80 100%);
    /* Red -> Yellow -> Green */
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.goldfish-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    letter-spacing: 0.5px;
}

/* Main Play Area */
.goldfish-play-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
    overflow: hidden;
    position: relative;
}

/* Unified Zone Styles */
.goldfish-zone {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.goldfish-zone:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.goldfish-zone.drag-over {
    background: var(--accent-glow);
    /* fallback if rgb var exists, else use solid */
    background: rgba(100, 100, 255, 0.05);
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Battlefield Zone */
.goldfish-zone.battlefield-zone {
    flex: 1;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.goldfish-zone.battlefield-zone .zone-cards.battlefield-cards {
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* Selection Box for Multi-Select */
.selection-box {
    position: absolute;
    background: rgba(100, 150, 255, 0.15);
    border: 2px dashed rgba(100, 150, 255, 0.6);
    border-radius: 4px;
    pointer-events: none;
    z-index: 1000;
}

/* Selected Card Highlight */
.goldfish-card.selected {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
    box-shadow: 0 0 20px var(--accent-glow);
}

.zone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.zone-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.zone-count {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: auto;
}

.zone-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-y: auto;
    min-height: 100px;
}

/* Battlefield */
.goldfish-battlefield-row {
    flex: 1;
    display: flex;
    gap: 24px;
    min-height: 300px;
    overflow: hidden;
    /* Ensure it doesn't spill out */
}

.goldfish-battlefield-container {
    flex: 1;
    display: flex;
    min-width: 0;
    /* Enable flex shrinking */
}

.battlefield-zone {
    flex: 1;
    /* Remove specific green background */
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    /* Anchor for absolute children */
    display: flex;
    flex-direction: column;
}

.battlefield-zone .zone-cards {
    flex: 1;
    /* Expand to fill available space */
    position: relative;
    /* Anchor for absolute positioned cards */
    height: 100%;
    min-height: 0;
}

/* Command Zone */
.goldfish-command-zone {
    width: 140px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    /* Darker for command zone */
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 12px;
    height: 100%;
}

.command-zone-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
}

.command-zone-cards img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Hand & Library Row */
.goldfish-bottom-row {
    display: flex;
    gap: 24px;
    height: 260px;
    flex-shrink: 0;
    min-width: 0;
    /* Crucial for nested flex scrolling */
}

.goldfish-hand-container {
    flex: 1;
    /* Should expand */
    min-width: 0;
    /* Allow shrinking if needed */
    display: flex;
    flex-direction: column;
}

.hand-zone {
    height: 100%;
    width: 100%;
    /* Remove teal background */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hand-zone .zone-cards {
    height: 100%;
    flex: 1;
    align-content: flex-start;
    overflow-x: auto;
    /* Scroll horizontally if many cards */
    overflow-y: hidden;
    flex-wrap: nowrap;
    /* Single row usually preferred for hand */
    padding-bottom: 8px;
    /* Scrollbar space */
}

/* Library */
.goldfish-library-container {
    width: 140px;
    flex-shrink: 0;
}

.goldfish-library-stack {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e1e2f 0%, #151520 100%);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.goldfish-library-stack:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-color);
}

.library-count {
    margin-top: 12px;
    font-weight: 700;
    color: var(--text-color);
}

/* Actions Bar */
.goldfish-actions-section {
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    padding: 12px 10px 24px 10px;
}

.goldfish-section-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.goldfish-section-toggle:hover {
    color: var(--text-color);
}

.goldfish-actions-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.goldfish-action-btn {
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.goldfish-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.goldfish-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Icons */
.goldfish-icon {
    display: inline-block;
    vertical-align: middle;
}

/* Card Styles - Minimal updates, reuse existing layout but clean up borders */
.goldfish-card {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.goldfish-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 100;
}

.goldfish-card.tapped {
    transform: rotate(90deg);
}

/* Dashbord Grid Layout */
.stats-dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1.2fr;
    gap: 12px;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    display: flex;
}

.primary-card {
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    background: rgba(255, 100, 100, 0.05);
    /* Subtle red tint for opponent */
    border-color: rgba(255, 100, 100, 0.2);
}

.resources-card {
    justify-content: space-around;
    align-items: center;
}

.metrics-card {
    justify-content: space-around;
    align-items: center;
}

.stat-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.turn-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.goldfish-status-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.goldfish-hp-bar {
    width: 100%;
    /* Full width of card */
    height: 16px;
    /* Slightly thinner */
}

/* Resources */
.resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.resource-info {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.resource-val {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
}

.resource-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Metrics */
.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.metric-val {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-color);
}

.metric-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Log */
.stats-log-row {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    gap: 8px;
}

.log-entries {
    display: flex;
    gap: 8px;
    overflow: hidden;
}

/* Missing "Legacy" Button Styles Replacement */
.goldfish-section-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.goldfish-section-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.goldfish-undo-btn,
.goldfish-sim-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.goldfish-undo-btn:hover,
.goldfish-sim-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.goldfish-undo-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Zone Toggle Badges (Graveyard/Exile) */
.goldfish-zones-split-row {
    display: flex;
    gap: 24px;
    margin-top: 12px;
}

.goldfish-zone.collapsed {
    height: auto;
    min-height: 0;
    flex: 1;
    /* Share width even when collapsed */
    padding-bottom: 0;
}

/* Ensure expanded zones share width and provide anchor for overlays */
.goldfish-zone.graveyard-zone,
.goldfish-zone.exile-zone {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Anchor for absolute zone-cards */
}

/* Graveyard & Exile Specific Overrides for Split Pane */
.goldfish-zone.graveyard-zone,
.goldfish-zone.exile-zone {
    padding: 0;
    /* Remove padding to let header be flush */
    gap: 0;
}

/* Header flush with container */
.goldfish-zone.graveyard-zone .collapsible-header,
.goldfish-zone.exile-zone .collapsible-header {
    margin: 0;
    padding: 12px 16px;
    border-radius: 12px;
    /* Match container radius */
}

/* Flatten scroll corners when expanded */
.goldfish-zone.graveyard-zone:not(.collapsed) .collapsible-header,
.goldfish-zone.exile-zone:not(.collapsed) .collapsible-header {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: 1px solid var(--border-color);
}

.goldfish-zone.graveyard-zone:not(.collapsed) .zone-cards,
.goldfish-zone.exile-zone:not(.collapsed) .zone-cards {
    position: absolute;
    bottom: 100%;
    left: -1px;
    /* Match outer border */
    right: -1px;
    height: auto;
    max-height: 400px;
    background: #0f111a;
    /* Explicit dark background for visibility */
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    z-index: 1000;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
    padding: 16px;
    overflow-y: auto;
    flex-direction: row;
    /* Keep cards in a row inside the scrollable area */
    flex-wrap: wrap;
    gap: 12px;
}

.collapsible-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.goldfish-zone.collapsed .collapsible-header {
    margin-bottom: 0;
}

.zone-count {
    margin-left: auto;
    margin-right: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.header-chevron {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Fix Card Sizing in Zones */
.zone-cards .goldfish-card {
    width: 120px;
    /* Reduced width as requested */
    flex-shrink: 0;
}

.goldfish-card-image {
    width: 100%;
    height: auto;
    border-radius: 4px;
    /* Matches outer radius */
    display: block;
}

/* Modals (Library & Token Search) */
.goldfish-library-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}

.goldfish-library-modal {
    width: 90%;
    max-width: 1000px;
    height: 80%;
    background: #1a1b26;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease-out;
}

.library-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.library-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.goldfish-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.goldfish-close-btn:hover {
    color: var(--text-color);
}

.library-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.02);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Library Modal Content Grid */
.library-modal-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.library-card-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.library-card-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.lib-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.lib-action-btn:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Fix SVG icons being shrunk to zero width in flex containers */
.lib-action-btn svg,
.lib-action-btn .ui-icon {
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    min-width: 1em;
    min-height: 1em;
}

/* Fix Large Hover Preview */
/* Assuming HoverPreview uses a class like .hover-preview-overlay or similar. 
   If it's just an img fixed positioned, let's target it implicitly if we can find it.
   But looking at modal.rs, it uses <HoverPreview>. I need to check HoverPreview component.
   For now, I'll add a generic rule that might help if it has a class.
*/
.goldfish-hover-preview {
    position: fixed;
    z-index: 4000;
    pointer-events: none;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    animation: fadeIn 0.15s ease-out;
}

.goldfish-hover-preview img {
    max-width: 300px;
    /* Constrain width */
    max-height: 50vh;
    /* Constrain height */
    border-radius: 10px;
}

/* Secondary Stats Row */
.secondary-stats {
    grid-template-columns: 1fr 1fr;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.probs-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prob-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prob-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 60px;
}

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

.prob-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.prob-badge.land {
    color: #fcd34d;
    border-color: rgba(252, 211, 77, 0.3);
}

.prob-badge.creature {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.3);
}

.prob-badge.spell {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
}

.prob-text-item {
    display: flex;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.tag-name {
    color: var(--text-color);
}

.tag-pct {
    font-weight: 700;
    color: var(--accent-light);
}

/* Log Card */
.log-card {
    flex-direction: column;
    overflow: hidden;
}

.log-content_scroller {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 80px;
    padding-right: 4px;
}

.log-entry-row {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 2px;
}

.log-turn {
    color: var(--accent-color);
    font-family: monospace;
    font-weight: 700;
    min-width: 24px;
}

.log-desc {
    color: var(--text-muted);
}

/* =============================================
   COMPACT STATS BAR STYLES
   ============================================= */

.goldfish-stats-bar.compact {
    padding: 8px 16px;
    gap: 8px;
}

.stats-compact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-compact-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-compact-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.stat-compact-value {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-color);
}

.stat-compact-value.accent {
    color: var(--accent-color);
    font-size: 1.1rem;
}

.stat-compact-icon {
    color: var(--text-muted);
}

.turn-control-compact {
    display: flex;
    align-items: center;
    gap: 6px;
}

.next-turn-btn-compact {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.next-turn-btn-compact:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px var(--accent-glow);
}

.stat-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

.probs-compact {
    display: flex;
    align-items: center;
    gap: 6px;
}

.probs-compact-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.prob-badge-compact {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.prob-badge-compact.land {
    color: #fcd34d;
}

.prob-badge-compact.creature {
    color: #34d399;
}

.prob-badge-compact.spell {
    color: #60a5fa;
}

.tags-compact {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tag-compact {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.log-compact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

.log-compact-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.log-entries-compact {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.log-entry-compact {
    display: flex;
    gap: 4px;
}

.log-turn-compact {
    color: var(--accent-color);
    font-weight: 700;
}

/* =============================================
   RIGHT PANEL STYLES (Command + Library)
   ============================================= */

.goldfish-main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 16px;
    min-height: 0;
    overflow: hidden;
}

.goldfish-left-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
    min-width: 0;
    overflow: hidden;
}

/* Top Zones Bar - Horizontal bar above battlefield with Command Zone (left) and Library (right) */
.goldfish-top-zones-bar {
    display: flex;
    justify-content: flex-start;
    align-items: stretch;
    gap: 16px;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

/* Individual top zone - Command Zone or Library */
.top-zone {
    flex: 1;
    position: relative;
    background: rgba(30, 30, 40, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    min-width: 0;
}

/* Top zone header - always visible */
.top-zone-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.top-zone-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.top-zone-header .zone-icon {
    color: var(--accent-color);
}

.top-zone-header .zone-label {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.top-zone-header .zone-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.top-zone-header .header-chevron {
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* Expanded overlay content - opens DOWNWARD */
.top-zone-content-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 30, 40, 0.98);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* When expanded, adjust the header border radius */
.top-zone.expanded {
    border-radius: 8px 8px 0 0;
}

.top-zone.expanded .top-zone-header {
    border-radius: 8px 8px 0 0;
}

/* Command Zone specific styling */
.command-zone-top .zone-cards.command-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.command-zone-top .goldfish-card {
    width: 100px;
    height: auto;
    aspect-ratio: 5 / 7;
}

.command-zone-top .goldfish-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Library Zone specific styling */
.library-zone-top {
    min-width: 140px;
}

.library-preview {
    padding: 12px;
}

.library-stack-clickable {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.library-stack-clickable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.library-stack-clickable .library-card-back {
    width: 80px;
    height: 112px;
    background: linear-gradient(135deg, #2d2d44 0%, #1a1a2e 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow:
        3px 3px 0 rgba(0, 0, 0, 0.3),
        6px 6px 0 rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.library-stack-clickable:hover .library-card-back {
    transform: translateY(-4px);
    box-shadow:
        3px 7px 0 rgba(0, 0, 0, 0.3),
        6px 10px 0 rgba(0, 0, 0, 0.2);
}

.library-count-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.library-count-overlay .library-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
}

.library-count-overlay .library-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.library-search-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}

.library-stack-clickable:hover .library-search-hint {
    opacity: 1;
}

/* Updated bottom row - Hand takes full width now */
.goldfish-bottom-row {
    height: 180px;
    flex-shrink: 0;
}

/* Battlefield row stretches */
/* Battlefield row stretches */
.goldfish-battlefield-row {
    flex: 1;
    display: flex;
    min-height: 200px;
    overflow: hidden;
}

.goldfish-battlefield-row .battlefield-zone {
    flex: 1;
}

.goldfish-zone {
    display: flex;
    flex-direction: column;
}

.goldfish-zone .zone-cards {
    flex: 1;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    min-height: 0;
}

/* Empty Zone States */
.zone-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    height: 100%;
    width: 100%;
    opacity: 0.1;
    pointer-events: none;
}

.zone-empty-state.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: auto;
    /* opacity and pointer-events are now inherited from base class */
}

/* Sideboarding Modal */
.goldfish-sideboarding-modal {
    width: 90vw;
    height: 85vh;
    background: #13141f;
    /* Dark bg */
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.sideboarding-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.sideboarding-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
    flex: 1;
}

.sideboarding-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 16px;
}

.sideboarding-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding: 16px;
    gap: 16px;
}

.sideboarding-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.column-header {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
}

.column-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.column-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sideboarding-card-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.sideboarding-card-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
    transform: translateX(2px);
}

.sideboarding-card-item.in-sideboard:hover {
    transform: translateX(-2px);
}

.sideboarding-card-item .card-name {
    flex: 1;
    color: var(--text-color);
    font-weight: 500;
}

.sideboarding-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.5;
}

.sideboarding-footer {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Stats Help Modal */
.stats-help-modal {
    width: 600px;
    max-width: 90%;
}

.stats-help-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.stat-help-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-help-item .stat-help-label {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1.1em;
}

.stat-help-item .stat-help-desc {
    color: var(--text-muted);
    font-size: 0.95em;
    line-height: 1.4;
}

.stat-help-divider {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
    opacity: 0.5;
}
.stats-help-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.stats-help-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.stat-help-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent-color);
}

.stat-help-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    color: var(--accent-color);
}

