/* ============================================
   Bad Games - Game CSS
   Game Page, Spell Cards, Chess Specific
   ============================================ */

/* ===========================================
   Player Names in Header
   =========================================== */
.game-players-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.player-name-header {
    padding: 6px 16px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.player-name-header.active {
    border-color: var(--success);
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
    font-weight: 600;
}

.vs-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.reset-btn {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
    margin-left: 8px;
}

.reset-btn:hover {
    opacity: 1;
}

/* ===========================================
   Main Game Page Layout
   =========================================== */
.game-page {
    display: flex;
    gap: 20px;
    padding: 16px 24px;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
    align-items: flex-start;
}

/* Board area - centered */
.game-board-area {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#game-canvas {
    border-radius: var(--border-radius);
    touch-action: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Cards area - right column with vertical cards */
.game-cards-area {
    width: 160px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Match the board height - calculated as canvas size */
    height: var(--board-height, 500px);
}

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    height: 100%;
}

/* ===========================================
   Spell Cards in Game Sidebar - MTG-style vertical cards
   =========================================== */
.spell-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid var(--type-color, var(--border-color));
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    /* Fill height evenly */
    flex: 1 1 0;
    min-height: 0;
}

.spell-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--type-color, var(--accent));
}

.spell-card:hover:not(.disabled) {
    transform: translateY(-3px);
    border-color: var(--type-color, var(--accent));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.spell-card.selected {
    border-color: var(--success);
    background: rgba(74, 222, 128, 0.15);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

.spell-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Header bar with name */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    background: linear-gradient(90deg, var(--type-color, var(--accent)) 0%, rgba(0,0,0,0.3) 100%);
    border-radius: 4px;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.card-name {
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Art box - RECTANGLE */
.card-icon {
    width: 100%;
    height: 50px;
    margin-bottom: 4px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0d0d1a 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--type-color, var(--border-color));
    flex-shrink: 0;
}

.card-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* Type line */
.card-type {
    padding: 2px 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 3px;
    margin-bottom: 4px;
    font-size: 0.55rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--type-color, var(--accent));
    text-align: center;
}

/* Text box - framed */
.card-desc {
    flex: 1;
    width: 100%;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.3;
    text-align: left;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-info {
    display: none;
}

/* Info button on cards - inside header */
.card-info-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    z-index: 5;
}

.card-info-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.15);
}

/* Deck info - now hidden, moved to header */
.deck-info {
    display: none;
}

/* Deck count in header */
.deck-count-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 12px;
}

.deck-count-header .deck-icon {
    font-size: 1rem;
}

.deck-count-header .deck-number {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===========================================
   Game Result Overlay
   =========================================== */
.game-result-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.game-result {
    text-align: center;
    padding: 48px;
}

.game-result h2 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.game-result p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ===========================================
   Chess Specific
   =========================================== */
.promotion-dialog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
}

.promotion-options {
    display: flex;
    gap: 12px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
}

.promotion-piece {
    width: 64px;
    height: 64px;
    padding: 8px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.promotion-piece:hover {
    border-color: var(--accent);
}

/* ===========================================
   Spell Panel (Modals)
   =========================================== */
.spell-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.spell-hand {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

/* Spell Card in spell-panel (modals) */
.spell-panel .spell-card {
    width: 90px;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    display: block;
}

.spell-panel .spell-card:hover:not(.disabled) {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

.spell-panel .spell-card.selected {
    border-color: var(--warning);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
    transform: translateY(-4px);
}

.spell-panel .spell-card.discard-option {
    border-color: var(--error);
    animation: pulse-discard 1s infinite;
}

.spell-panel .spell-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spell-panel .card-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spell-panel .card-icon img {
    filter: brightness(0) invert(1);
}

.spell-panel .card-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spell-panel .card-type {
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.spell-panel .card-desc {
    font-size: 0.55rem;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Spell Actions */
.spell-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

/* ===========================================
   Spell Animations
   =========================================== */
@keyframes pulse-discard {
    0%, 100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
}

@keyframes damage-flash {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(2) sepia(1) saturate(5) hue-rotate(-30deg); }
}

@keyframes heal-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(74, 222, 128, 0); }
    50% { box-shadow: 0 0 20px rgba(74, 222, 128, 0.8); }
}

@keyframes floating-damage {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); }
}

@keyframes freeze-effect {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.3) saturate(0.5) hue-rotate(180deg); }
}

@keyframes modal-appear {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Floating damage number */
.floating-damage {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: #e94560;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    animation: floating-damage 1s ease-out forwards;
}

.floating-heal {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ade80;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    animation: floating-damage 1s ease-out forwards;
}

/* ===========================================
   Turn Action Modal
   =========================================== */
.turn-action-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--accent);
    padding: 1rem;
    margin-bottom: 1rem;
    animation: modal-appear 0.3s ease-out;
}

.turn-action-modal h3 {
    color: var(--accent);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.turn-prompt {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.turn-action-buttons {
    display: flex;
    gap: 0.75rem;
}

.turn-action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem 0.5rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.turn-action-btn:hover {
    transform: translateY(-2px);
}

.turn-action-btn .action-icon {
    font-size: 1.5rem;
}

.turn-action-btn .action-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===========================================
   Spell Selection Modal
   =========================================== */
.spell-select-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--accent);
    padding: 1rem;
    margin-bottom: 1rem;
    animation: modal-appear 0.3s ease-out;
}

.spell-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.spell-select-header h3 {
    color: var(--accent);
    font-size: 1rem;
    margin: 0;
}

.modal-back-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.modal-back-btn:hover {
    background: var(--accent);
}

.spell-select-cards {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.spell-select-cards .spell-card {
    width: 90px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spell-select-cards .spell-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(233, 69, 96, 0.3);
}

/* ===========================================
   Spell Detail Modal
   =========================================== */
.spell-detail-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--accent);
    padding: 1.5rem;
    margin-bottom: 1rem;
    animation: modal-appear 0.3s ease-out;
}

.spell-detail-content {
    text-align: center;
    position: relative;
}

.spell-detail-close {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.spell-detail-close:hover {
    background: var(--accent);
}

.spell-detail-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spell-detail-icon img {
    width: 60px;
    height: 60px;
    filter: brightness(0) invert(1);
}

.spell-detail-name {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.spell-detail-type {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.spell-detail-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.spell-detail-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ===========================================
   Discard Modal
   =========================================== */
.discard-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 3px solid var(--warning);
    padding: 1.5rem;
    z-index: 1000;
    min-width: 280px;
    max-width: 90vw;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modal-appear 0.3s ease-out;
}

.discard-modal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: -1;
}

.discard-modal h3 {
    color: var(--warning);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.discard-cards {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.discard-cards .spell-card {
    width: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.discard-cards .spell-card:hover {
    transform: translateY(-4px);
    border-color: var(--error);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.discard-cancel-btn {
    display: block;
    margin: 1rem auto 0;
    padding: 0.5rem 1.5rem;
}

/* ===========================================
   Spell Cast Modal (Card-style)
   =========================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.spell-cast-modal {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--accent);
    padding: 1.5rem;
    max-width: 400px;
    width: 90vw;
    animation: modal-appear 0.3s ease-out;
}

.spell-cast-modal h2 {
    text-align: center;
    color: var(--accent);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Main spell card being cast - MTG-style vertical card */
.cast-spell-card {
    position: relative;
    width: 200px;
    height: 280px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
    border-radius: 12px;
    border: 3px solid var(--type-color, var(--accent));
    padding: 10px;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cast-spell-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--type-color, var(--accent));
}

.cast-card-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle at center, var(--type-color, var(--accent)) 0%, transparent 70%);
    opacity: 0.1;
    pointer-events: none;
}

/* Header bar with name */
.cast-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: linear-gradient(90deg, var(--type-color, var(--accent)) 0%, rgba(0,0,0,0.3) 100%);
    border-radius: 6px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.cast-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    text-align: left;
}

.cast-card-cost {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--type-color, var(--accent));
    background: rgba(0,0,0,0.4);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Art box - RECTANGLE */
.cast-card-icon {
    width: 100%;
    height: 100px;
    margin-bottom: 6px;
    background: linear-gradient(180deg, #1a1a2e 0%, #0d0d1a 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--type-color, var(--border-color));
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.cast-card-icon img {
    width: 64px;
    height: 64px;
    filter: brightness(0) invert(1);
}

/* Type line below art */
.cast-card-type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--type-color, var(--accent));
    position: relative;
    z-index: 1;
}

/* Text box - framed */
.cast-card-desc {
    flex: 1;
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 2px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
    position: relative;
    z-index: 1;
    text-align: left;
    overflow-y: auto;
}

/* Info button on cast spell card */
.cast-spell-card .cast-info-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

/* Spell detail card (info modal) - 30% bigger, no image */
.spell-detail-card {
    position: relative;
    width: 260px;
    height: 320px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%);
    border-radius: 12px;
    border: 3px solid var(--type-color, var(--accent));
    padding: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.spell-detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--type-color, var(--accent));
}

.spell-detail-card .cast-card-header {
    padding: 8px 12px;
    margin-bottom: 10px;
}

.spell-detail-card .cast-card-name {
    font-size: 1.1rem;
}

.spell-detail-card .cast-card-type {
    padding: 6px 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
}

.spell-detail-card .cast-card-desc {
    flex: 1;
    padding: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Discard selection section */
.discard-section {
    margin-bottom: 1rem;
}

.discard-section h3 {
    font-size: 0.9rem;
    color: var(--warning);
    text-align: center;
    margin-bottom: 0.75rem;
}

.discard-cards-row {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Individual discard card - mini card style */
.discard-card {
    position: relative;
    width: 100px;
    background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.discard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--type-color, var(--accent));
    border-radius: 8px 8px 0 0;
}

.discard-card:hover {
    transform: translateY(-4px);
    border-color: var(--type-color, var(--warning));
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.discard-card.selected {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
    transform: translateY(-4px);
}

.discard-card .discard-info-btn {
    position: absolute;
    top: 6px;
    right: 4px;
    width: 16px;
    height: 16px;
    font-size: 9px;
}

.discard-card-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    padding-right: 16px;
}

.discard-card-icon {
    width: 100%;
    height: 40px;
    margin-bottom: 4px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.discard-card-icon img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
}

.discard-card-type {
    font-size: 0.55rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--type-color, var(--text-muted));
    margin-bottom: 4px;
}

.discard-card-desc {
    font-size: 0.55rem;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

/* Modal buttons */
.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.modal-buttons .btn {
    min-width: 100px;
}

.modal-buttons .cast-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===========================================
   Reset Test Modal
   =========================================== */
.reset-modal {
    max-width: 600px;
}

.reset-modal h2 {
    text-align: center;
    margin-bottom: 8px;
}

.reset-modal p {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.spell-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.reset-spell-card {
    padding: 12px 8px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-color);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.reset-spell-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.reset-spell-card .spell-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 8px;
    filter: brightness(0) invert(1);
}

.reset-spell-card .spell-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.reset-spell-card .spell-desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* ===========================================
   Mobile Layout
   =========================================== */
@media (max-width: 768px) {
    .game-page {
        flex-direction: column;
        align-items: center;
        padding: 12px;
        gap: 12px;
    }

    .game-cards-area {
        width: 100%;
        max-width: 400px;
    }

    .cards-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .spell-card {
        width: 100px;
        padding: 8px 6px 6px;
    }

    .card-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 4px;
    }

    .card-icon img {
        width: 20px;
        height: 20px;
    }

    .card-name {
        font-size: 0.7rem;
    }

    .card-type {
        font-size: 0.5rem;
    }

    .card-desc {
        display: none;
    }

    .card-info-btn {
        width: 14px;
        height: 14px;
        font-size: 8px;
    }

    .deck-count-header {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

@media (max-width: 600px) {
    .spell-panel {
        padding: 0.75rem;
    }

    .spell-panel .spell-card {
        width: 75px;
        padding: 0.375rem;
    }

    .spell-panel .card-icon {
        width: 32px;
        height: 32px;
    }

    .spell-panel .card-name {
        font-size: 0.6rem;
    }

    .spell-panel .card-type {
        font-size: 0.5rem;
    }

    .spell-panel .card-desc {
        font-size: 0.5rem;
        -webkit-line-clamp: 1;
    }
}
