/* ============================================
   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 - Default Full Screen Fixed (Best for Mobile) */
.goldfish-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 3000;
    /* Over everything on mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

/* Main Modal Container - Default Full Screen */
.goldfish-modal {
    width: 100vw;
    height: 100vh;
    background: var(--bg-gradient);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border-radius: 0;
    border: none;
}

/* Desktop: Integrated view filling only the panel space */
@media (min-width: 769px) {
    .goldfish-modal-overlay {
        position: absolute;
        /* Relative to the .deck-panel */
        z-index: 1000;
        /* Stays within the panel context */
        backdrop-filter: blur(8px);
        /* Keep the blur effect relative to the panel */
    }

    .goldfish-modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

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

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

.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: var(--entry-hover-bg);
    color: #ef4444;
}

/* Stats Section */
.goldfish-stats-section {
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.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 var(--accent-glow);
}

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

/* HP Bar */
.tags-compact {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    flex: 1;
    height: 26px;
    overflow: hidden;
    align-items: center;
}

.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: var(--input-bg);
    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 2px rgba(0, 0, 0, 0.5);
    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: var(--widget-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.goldfish-zone:hover {
    background: var(--entry-hover-bg);
    border-color: var(--border-hover);
    box-shadow: var(--popup-shadow);
}

.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: 100px;
    /* Allow shrinking further */
    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: 8px;
    padding-bottom: 6px;
    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: var(--button-bg);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: auto;
}

.header-chevron {
    color: var(--text-muted);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.zone-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-y: auto;
    min-height: 10px;
    /* Reduced to allow collapse */
}

/* Battlefield */
.goldfish-battlefield-row {
    flex: 1;
    display: flex;
    gap: 24px;
    min-height: 100px;
    /* Reduced to allow shrinking */
    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: var(--bg-tertiary);
    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: var(--widget-bg);
    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);
}

.goldfish-bottom-row {
    display: flex;
    gap: 8px;
    flex: 0 1 180px;
    min-height: 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;
}

.goldfish-zone.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 */
}

/* Prevent shrinking cards in hand to ensure scroll triggers */
.goldfish-zone.hand-zone .goldfish-card {
    flex-shrink: 0;
}

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

.goldfish-library-stack {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: var(--bg-gradient);
    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: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    padding: 12px 10px 12px 10px;
    flex-shrink: 0;
}

.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: var(--button-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.actions-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.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 {
    position: relative;
    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;
}

.commander-card {
    position: relative;
}

.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: var(--button-bg);
    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: 8px;
}

.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: 4px 10px !important;
    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: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--popup-shadow);
    animation: slideUp 0.3s ease-out;
}

.library-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-bg);
}

.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-color);
    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 var(--border-color);
    display: flex;
    justify-content: flex-end;
    background: var(--panel-bg);
}

@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;
    background: var(--bg-color);
}

/* Search Functionality in Modals */
.search-bar-container {
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all 0.2s;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.search-helper-text {
    margin: 8px 0 0 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.search-empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    grid-column: 1 / -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: var(--button-bg);
    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: var(--input-bg);
    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: var(--bg-tertiary);
    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 var(--border-color);
    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: var(--input-bg);
    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: var(--bg-tertiary);
    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;
}

/* Mobile: Single row with horizontal scroll */
@media (max-width: 768px) {
    .log-entries-compact {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        scrollbar-color: var(--accent-color) transparent;
        padding-bottom: 4px;
    }

    .log-entries-compact::-webkit-scrollbar {
        height: 4px;
    }

    .log-entries-compact::-webkit-scrollbar-track {
        background: transparent;
    }

    .log-entries-compact::-webkit-scrollbar-thumb {
        background: var(--accent-color);
        border-radius: 2px;
    }

    .log-entry-compact {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

.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: 8px;
    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: 8px;
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

/* Individual top zone - Command Zone or Library */
.top-zone {
    flex: 1;
    position: relative;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--popup-shadow);
    min-width: 0;
    padding: 0 !important;
}

/* Top zone header - always visible */
.top-zone-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px !important;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.top-zone-header:hover {
    background: var(--entry-hover-bg);
}

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

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

.top-zone-header .zone-count {
    margin-left: auto;
    background: var(--button-bg);
    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: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 8px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: var(--popup-shadow);
    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;
    align-self: stretch;
    display: flex;
    flex-direction: column;
}

.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: var(--entry-hover-bg);
}

.library-stack-clickable .library-card-back {
    width: 80px;
    height: 112px;
    background: var(--accent-gradient);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow:
        3px 3px 0 rgba(0, 0, 0, 0.1),
        6px 6px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

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

.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 {
    flex: 0 1 180px;
    /* Allow shrinking if needed, max 180px */
    min-height: 0;
}

/* Battlefield row stretches */
/* Battlefield row stretches */
.goldfish-battlefield-row {
    flex: 1;
    display: flex;
    min-height: 0;
    /* Allow total flexibility */
    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: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--popup-shadow);
    animation: fadeIn 0.3s ease-out;
}

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

.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: var(--panel-bg);
    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: var(--button-bg);
    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: var(--panel-bg);
    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);
}

/* ============================================
   MOBILE PORTRAIT STYLES
   ============================================ */

@media (max-width: 768px) and (orientation: portrait) {

    /* Full-screen modal */
    .goldfish-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
    }

    /* Compact header */
    .goldfish-header {
        padding: 12px 16px 8px 16px;
    }

    .goldfish-title-text {
        font-size: 1rem;
    }

    .goldfish-deck-name {
        font-size: 0.8rem;
    }

    .goldfish-close-btn {
        width: 44px;
        height: 44px;
    }

    /* Compact stats bar */
    .goldfish-stats-bar {
        padding: 8px 12px;
    }

    .stats-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 8px;
    }

    .stat-value {
        font-size: 1.1em;
    }

    .stat-label {
        font-size: 0.7em;
    }

    /* Hide stats toggle text */
    .stats-toggle-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 0;
    }

    .stats-toggle-btn svg {
        font-size: 20px;
    }

    /* Play area - vertical layout */
    .goldfish-play-area {
        padding: 8px;
        gap: 8px;
        flex-direction: column;
    }

    /* Zones - collapsible drawers */
    .goldfish-zone {
        padding: 8px;
        min-height: auto;
    }

    .zone-header {
        padding: 6px 8px;
    }

    .zone-title {
        font-size: 0.75em;
    }

    .zone-cards {
        min-height: 40px;
        /* Reduced to stop excessive gaps */
        gap: 6px;
    }

    /* Cards smaller on mobile */
    .goldfish-card {
        width: 70px;
    }

    .goldfish-card img {
        width: 100%;
        border-radius: 4px;
    }

    /* Tapped cards still rotated but smaller */
    .goldfish-card.tapped {
        transform: rotate(90deg);
    }

    /* Hand zone at bottom with horizontal scroll */
    .goldfish-bottom-row {
        flex: none;
        /* Don't stretch or use desktop's 180px basis */
        height: auto;
        min-height: 0;
        flex-direction: column;
    }

    .goldfish-hand-container {
        flex: none;
        /* Override desktop flex: 1 — hug content height on mobile */
        height: auto;
        max-height: 120px;
        min-height: 0;
    }

    .goldfish-zone.hand-zone {
        width: 100%;
    }

    .goldfish-zone.hand-zone .zone-cards {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        padding: 8px;
        -webkit-overflow-scrolling: touch;
    }

    /* Command zone as compact bar */
    .goldfish-command-zone {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 8px;
        min-width: 0;
    }

    .command-zone-cards {
        flex-direction: row;
        gap: 8px;
    }

    .command-zone-cards img {
        width: 50px;
    }

    /* Library container compact */
    .goldfish-library-container {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        gap: 12px;
    }

    .library-pile,
    .graveyard-pile,
    .exile-pile {
        width: 70px;
    }

    /* Actions bar at bottom in flow (not fixed) to prevent overlap */
    .goldfish-actions-bar {
        position: relative;
        /* Reverted from fixed */
        background: var(--panel-bg);
        backdrop-filter: var(--glass-blur);
        padding: 12px 16px;
        z-index: 200;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        border-top: 1px solid var(--border-color);
        scrollbar-width: none;
    }

    .goldfish-actions-bar::-webkit-scrollbar {
        display: none;
    }

    .goldfish-action-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    .goldfish-action-btn svg,
    .goldfish-action-btn .btn-icon {
        width: 20px;
        height: 20px;
        font-size: 20px !important;
    }

    /* Context menu mobile-friendly */
    .goldfish-context-menu {
        min-width: 200px;
    }

    .context-menu-item {
        padding: 12px;
        min-height: 44px;
    }

    /* Token/counter modals */
    .counter-modal,
    .token-modal {
        width: 90vw;
        max-width: 320px;
    }

    /* Modal adjust button sizes */
    .counter-adjust-btn {
        width: 44px;
        height: 44px;
    }

    /* Mulligan modal */
    .mulligan-modal-content {
        width: 95vw;
        max-height: 80vh;
        overflow-y: auto;
    }
}

@media (max-width: 768px) and (orientation: landscape) {

    /* Landscape mode - use more horizontal space */
    .goldfish-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .goldfish-header {
        padding: 8px 16px;
    }

    .goldfish-title-text {
        font-size: 0.9rem;
    }

    .goldfish-play-area {
        flex-direction: row;
        padding: 8px;
    }

    .goldfish-card {
        width: 60px;
    }

    .goldfish-actions-bar {
        position: fixed;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        bottom: auto;
        left: auto;
        width: auto;
        flex-direction: column;
        padding: 8px;
        border-radius: 8px 0 0 8px;
        border-left: 1px solid var(--border-color);
    }

    .goldfish-action-btn {
        min-width: 40px;
        min-height: 40px;
    }
}

/* Fix for shorter desktop windows - more aggressive shrinking */
@media (max-height: 800px) {
    .goldfish-header {
        padding: 8px 16px !important;
    }

    .goldfish-stats-bar {
        padding: 4px 16px !important;
    }

    .goldfish-play-area {
        padding: 6px !important;
        gap: 6px !important;
    }

    .goldfish-bottom-row {
        flex-basis: 140px !important;
    }

    .top-zone-header {
        padding: 2px 8px !important;
    }

    /* Actions bar gets more compact and scrollable instead of wrapping */
    .goldfish-actions-bar {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        justify-content: flex-start !important;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .goldfish-actions-bar::-webkit-scrollbar {
        display: none;
    }

    .actions-group {
        padding: 2px 8px !important;
        flex-shrink: 0;
    }

    .actions-group-label {
        font-size: 0.6rem !important;
        margin-right: 2px !important;
    }

    .goldfish-action-btn {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }

    .goldfish-actions-section {
        padding-top: 4px !important;
        padding-bottom: 4px !important;
    }
}

/* Mobile Overrides */
@media (max-width: 768px) {
    .goldfish-modal {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    /* Header: Icon-only buttons */
    .goldfish-header .btn-text {
        display: none;
    }

    .goldfish-title-text {
        font-size: 1rem;
    }

    .goldfish-deck-name {
        display: none;
        /* Hide deck name on mobile to save space */
    }

    .goldfish-header {
        padding: 12px 16px;
    }

    /* Ensure close button is visible */
    .goldfish-close-btn {
        display: flex !important;
        width: 32px;
        height: 32px;
        background: var(--button-bg);
        /* Make it stand out a bit */
    }

    /* Actions Bar: Horizontal Scroll */
    .goldfish-actions-bar {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        justify-content: flex-start !important;
        padding-bottom: 8px;
        /* Space for scrollbar */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .goldfish-actions-bar::-webkit-scrollbar {
        display: none;
    }

    .actions-group {
        flex-shrink: 0;
    }

    /* Stats Bar: compact & scrollable */
    .stats-compact-row {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 16px !important;
        padding-bottom: 2px;
    }

    .stats-compact-row::-webkit-scrollbar {
        display: none;
    }

    /* Card Size: 50% smaller on mobile */
    .goldfish-card,
    .zone-cards .goldfish-card {
        width: 60px;
        /* 50% of desktop 120px */
    }

    .stat-compact-item,
    .probs-compact,
    .tags-compact {
        flex-shrink: 0;
    }

    /* Tag Stats: Part of the single scrollable row now */
    .tags-compact {
        flex-wrap: nowrap !important;
        height: auto !important;
        align-items: center !important;
        overflow: visible !important;
        flex-basis: auto !important;
        width: auto !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
        padding-bottom: 0 !important;
    }

    .stat-divider {
        display: block !important;
        opacity: 0.3;
        flex-shrink: 0;
    }
}

/* Drawers Container & Responsive Logic */
.drawers-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 40px;
    z-index: 100;
    pointer-events: none;
    transition: all 0.3s ease;
    transform: translateX(0);
}

.drawers-container.active {
    gap: 8px;
}

.drawers-container.mana-active {
    transform: translateX(70px);
}

.drawers-container.dice-active {
    transform: translateX(-70px);
}

@media (max-width: 768px) {
    .drawers-container {
        gap: 6px;
        width: 100%;
        padding: 0 4px;
        box-sizing: border-box;
    }

    .drawers-container.active {
        gap: 0;
        transform: none !important;
        /* Disable shift on mobile */
        justify-content: center;
    }

    /* On mobile, when one is open, hide the other to save space */
    .drawers-container.mana-active>div:last-child {
        display: none;
    }

    .drawers-container.dice-active>div:first-child {
        display: none;
    }

    /* Ensure content inside doesn't overflow */
    .dice-drawer-content,
    .mana-drawer-content {
        max-width: 90vw;
    }

    /* Compact Tabs */
    .mana-drawer-toggle,
    .dice-drawer-toggle {
        padding: 4px 8px !important;
        font-size: 0.75em !important;
        gap: 4px !important;
        white-space: nowrap;
    }
}