/**
 * Deck Details Modal Styles
 * Shared styles for the deck modal component used by My Decks and Public Decks
 */

/* Deck Modal - Core Layout */
#deckModal .modal-content,
#deckModal .deck-modal-content {
    background: var(--modal-bg);
    max-width: none;
    width: 95vw;
}

#deckModal .deck-modal-content .modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 20px 20px;
}

/* Split Layout Container - TWO COLUMN LAYOUT */
#deckModal .modal-body .deck-modal-split-layout,
#deckModal .deck-modal-content .modal-body .deck-modal-split-layout,
#deckModal .deck-modal-split-layout {
    display: flex !important;
    flex-direction: row !important;
    gap: 24px !important;
    flex: 1 !important;
    min-height: 0 !important;
    width: 100% !important;
    align-items: flex-start !important;
}

/* Left Side: Deck Cards - 50% width */
#deckModal .modal-body .deck-modal-left,
#deckModal .deck-modal-content .modal-body .deck-modal-left,
#deckModal .deck-modal-left {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    overflow-y: auto !important;
    max-height: 60vh !important;
    padding-right: 16px !important;
    display: block !important;
}

/* Right Side: Analytics - 50% width */
#deckModal .modal-body .deck-modal-right,
#deckModal .deck-modal-content .modal-body .deck-modal-right,
#deckModal .deck-modal-right {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    overflow-y: auto !important;
    max-height: 60vh !important;
    display: block !important;
}

/* Custom scrollbar for split sections */
#deckModal .deck-modal-left::-webkit-scrollbar,
#deckModal .deck-modal-right::-webkit-scrollbar {
    width: 6px;
}

#deckModal .deck-modal-left::-webkit-scrollbar-track,
#deckModal .deck-modal-right::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 3px;
}

#deckModal .deck-modal-left::-webkit-scrollbar-thumb,
#deckModal .deck-modal-right::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

#deckModal .deck-modal-left::-webkit-scrollbar-thumb:hover,
#deckModal .deck-modal-right::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Modal Header */
#deckModal .deck-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-primary);
    position: relative;
}

#deckModal .deck-modal-header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    min-width: 0;
    position: relative;
}

#deckModal .deck-modal-header-menu-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--button-secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#deckModal .deck-modal-header-menu-btn:hover {
    background: var(--button-secondary-hover);
}

#deckModal .deck-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#deckModal .deck-modal-header .close {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    flex-shrink: 0;
}

#deckModal .deck-modal-header .close:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

/* Creator Info in Footer */
#deckModal .creator-info-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

#deckModal .creator-info-footer .creator-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

#deckModal .creator-info-footer .creator-name-small {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Modal Footer with three columns */
#deckModal .deck-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--surface-secondary);
    border-top: 1px solid var(--border-primary);
    font-size: 12px;
    color: var(--text-secondary);
}

#deckModal .deck-modal-footer > * {
    flex: 1;
}

#deckModal .deck-modal-footer > *:first-child {
    text-align: left;
}

#deckModal .deck-modal-footer > *:nth-child(2) {
    text-align: center;
}

#deckModal .deck-modal-footer > *:last-child {
    text-align: right;
}

/* Modal timestamp styles */
#deckModal .modal-timestamp {
    font-size: 12px;
    color: var(--text-secondary, #999);
}

/* Rating Panel */
#deckModal .deck-rating-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    overflow: visible;
    display: block;
    margin-bottom: 16px;
    position: relative;
}

/* Deck Statistics Row - Rating, Views, Favorites */
#deckModal .deck-statistics-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    flex-wrap: wrap;
}

#deckModal .deck-statistics-row .rating-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

#deckModal .deck-statistics-row .user-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#deckModal .deck-statistics-row .user-rating label {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 600;
    text-align: center;
}

/* Deck Stat Items (Views, Favorites) */
#deckModal .deck-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    font-size: 13px;
}

#deckModal .deck-stat-item .stat-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
}

#deckModal .deck-stat-item .stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

#deckModal .deck-stat-item .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

#deckModal .rating-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

#deckModal .rating-text {
    font-size: 14px;
    color: var(--text-secondary, #666);
}

#deckModal .user-rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

#deckModal .rating-input {
    display: flex;
    gap: 5px;
}

#deckModal .star-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #ddd;
    cursor: pointer;
    padding: 2px;
    transition: color 0.2s;
    border-radius: 2px;
}

#deckModal .star-btn:hover,
#deckModal .star-btn.active {
    color: #ffd700;
}

#deckModal .star-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ========================================
   Stars and Favorite Button (Generic)
   Used in both modal and deck page
   ======================================== */

.stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 18px;
    color: var(--color-warning);
}

.star.filled {
    color: var(--color-warning);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn-favorite-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--button-secondary-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-favorite-icon:hover {
    background: var(--button-secondary-hover);
    transform: translateY(-2px);
}

.btn-favorite-icon.favorited {
    background: var(--color-error-bg);
    border-color: var(--color-error);
}

.favorite-icon {
    font-size: 20px;
}

.btn-favorite-icon.favorited .favorite-icon {
    color: var(--color-error);
}

/* Description Panel */
#deckModal .deck-description-panel {
    padding: 16px;
    border-top: 1px solid var(--border-primary);
    background: var(--card-bg);
}

#deckModal .deck-description-panel p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
}

/* YouTube Embed Panel */
#deckModal .deck-youtube-panel {
    padding: 16px;
    border-top: 1px solid var(--border-primary);
    background: var(--card-bg);
}

#deckModal .youtube-embed-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

#deckModal .youtube-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Action Buttons Row */
#deckModal .deck-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Deck Analytics Section */
#deckModal .deck-analytics {
    padding: var(--spacing-md);
    background: var(--panel-bg);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

#deckModal .deck-analytics.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
    border: none;
}

#deckModal .deck-analytics h4 {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

/* Analytics grid for sidebar - 3 columns */
#deckModal .deck-modal-right .analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

#deckModal .analytics-card {
    background: var(--card-bg);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 0;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#deckModal .analytics-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#deckModal .analytics-content {
    font-size: 13px;
    color: var(--text-primary);
}

#deckModal .analytics-highlight {
    font-size: 20px;
    font-weight: 700;
    color: #3498db;
    text-align: center;
}

#deckModal .analytics-card-bottom {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#deckModal .analytics-card-content-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Vertical Bar Graph Styles */
#deckModal .vertical-bar-graph {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    justify-content: center;
    height: 120px;
    padding-top: 10px;
}

#deckModal .vertical-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    max-width: 60px;
}

#deckModal .vertical-bar-container {
    position: relative;
    width: 100%;
    height: 100px;
    background: var(--input-bg);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

#deckModal .vertical-bar-fill {
    position: relative;
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 4px;
}

#deckModal .vertical-bar-count {
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

#deckModal .vertical-bar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

/* Deck Sections */
#deckModal .deck-section {
    margin-top: 10px;
}

#deckModal .section-title {
    margin: 0 0 15px 0;
    color: var(--text-primary, #2c3e50);
    font-size: 1.1rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
}

/* Cards Grid in Modal */
#deckModal .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

#deckModal .card-grid-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
    cursor: pointer;
}

#deckModal .card-grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: var(--z-hover);
}

#deckModal .card-grid-item img {
    width: 100%;
    height: auto;
    display: block;
}

#deckModal .card-quantity-badge {
    position: absolute;
    bottom: 45px;
    right: 6px;
    background: #e74c3c;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#deckModal .card-uuid-label {
    text-align: center;
    padding: 6px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    background: var(--card-bg, white);
    border-top: 1px solid var(--border-primary, #e9ecef);
}

/* Card highlighting when trait/effect badge is clicked */
#deckModal .card-grid-item.highlighted {
    box-shadow: 0 0 0 3px var(--color-primary), 0 4px 12px rgba(52, 152, 219, 0.4);
    transform: scale(1.02);
    z-index: 2;
}

#deckModal .card-grid-item.dimmed {
    opacity: 0.35;
    filter: grayscale(50%);
}

#deckModal .card-grid-item.dimmed:hover {
    opacity: 0.6;
    filter: grayscale(25%);
}

/* Menu dropdown styles are now centralized in dropdown-menu.css */

/* ========================================
   Traits Section Styling
   ======================================== */

.traits-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--surface-secondary);
    border-radius: 8px;
}

.traits-section .analytics-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.traits-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.traits-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.trait-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    transition: all var(--transition-fast);
}

.trait-badge:hover {
    border-color: var(--accent-primary);
    background: var(--surface-hover);
}

.trait-badge-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.trait-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--accent-primary);
    color: var(--text-on-accent);
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

/* Effects Section Styles */
.effects-section {
    margin-top: 20px;
    padding: 20px;
    background: var(--surface-secondary);
    border-radius: 8px;
}

.effects-section .analytics-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.effects-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.effects-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.effect-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--border-primary);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.effect-badge:hover {
    border-color: var(--accent-primary);
    background: var(--surface-hover);
}

.effect-badge-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.effect-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--accent-primary);
    color: var(--text-on-accent);
    font-size: 12px;
    font-weight: 600;
    border-radius: 12px;
}

.no-effects {
    color: var(--text-tertiary);
    font-style: italic;
}

/* ========================================
   Highlightable Badge Styles
   ======================================== */

.highlightable-badge {
    cursor: pointer;
    user-select: none;
}

.highlightable-badge.active {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.highlightable-badge.active .trait-badge-name,
.highlightable-badge.active .effect-badge-name {
    color: white !important;
}

.highlightable-badge.active .trait-badge-count,
.highlightable-badge.active .effect-badge-count {
    background: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

/* ========================================
   Collection Analytics Tile
   ======================================== */

.collection-highlight-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid var(--border-primary, #ddd);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #667eea;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-secondary, #666);
    user-select: none;
}

/* Missing Cards Card */
.analytics-card.clickable-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.analytics-card.clickable-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.buy-cards-link {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-primary, #ddd);
    font-size: 0.875rem;
    color: #667eea;
    text-align: center;
    font-weight: 500;
}

.analytics-card.clickable-card:hover .buy-cards-link {
    color: #764ba2;
}

/* Collection Comparison Badges */
.card-quantity-badge.collection-complete {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    font-weight: 700;
}

.card-quantity-badge.collection-incomplete {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
    font-weight: 700;
}

/* Price disclaimer sub-text styling */
.price-disclaimer {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* ========================================
   MSA / GDSim / Clone Modals
   ======================================== */

#msaInstructionsModal,
#gdSimInstructionsModal,
#cloneDeckModal {
    z-index: var(--z-deck-modal-stacked) !important;
}

.msa-modal-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.msa-modal-body {
    padding: 20px 30px;
}

.msa-instructions {
    background: var(--surface-secondary, #f8f9fa);
    padding: 20px;
    border-radius: 8px;
}

.msa-instructions h3 {
    color: var(--text-primary, #2c3e50);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.msa-steps {
    list-style: none;
    padding: 0;
    counter-reset: step-counter;
}

.msa-steps li {
    counter-increment: step-counter;
    margin-bottom: 25px;
    padding-left: 0;
}

.msa-steps li strong {
    display: block;
    color: var(--primary-color, #3498db);
    margin-bottom: 10px;
    font-size: 1.05em;
}

.msa-steps li p {
    margin: 8px 0;
    color: var(--text-secondary, #6c757d);
    line-height: 1.6;
}

.msa-steps li a {
    color: var(--primary-color, #3498db);
    text-decoration: none;
    font-weight: 500;
}

.msa-steps li a:hover {
    text-decoration: underline;
}

.copy-feedback {
    color: #27ae60;
    font-weight: 500;
    margin-top: 10px;
    display: inline-block;
}

/* GDSim Export button */
#gdSimExportTextBtn {
    border-radius: var(--radius-md) !important;
}

/* ========================================
   Delete Deck Confirmation Modal
   ======================================== */

#deleteDeckModal .modal-body {
    text-align: center;
    padding: 2rem;
}

#deleteDeckModal .delete-warning {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

#deleteDeckModal .delete-deck-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

#deleteDeckModal .delete-notice {
    font-size: 0.9rem;
    color: var(--color-error);
    margin-bottom: 1.5rem;
}

#deleteDeckModal .form-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
    /* Stack split layout on tablets and smaller */
    #deckModal .modal-body .deck-modal-split-layout,
    #deckModal .deck-modal-content .modal-body .deck-modal-split-layout,
    #deckModal .deck-modal-split-layout {
        flex-direction: column !important;
    }

    #deckModal .modal-body .deck-modal-left,
    #deckModal .modal-body .deck-modal-right,
    #deckModal .deck-modal-left,
    #deckModal .deck-modal-right {
        flex: 1 1 auto !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        overflow-y: visible !important;
        padding-right: 0 !important;
    }

    #deckModal .deck-modal-right {
        border-top: 1px solid var(--border-primary);
        padding-top: 20px;
        margin-top: 16px;
    }

    #deckModal .deck-modal-right .analytics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    #deckModal .deck-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }

    /* Ensure panels have proper height on mobile - override desktop 60vh */
    #deckModal .modal-body .deck-modal-left,
    #deckModal .modal-body .deck-modal-right,
    #deckModal .deck-modal-content .modal-body .deck-modal-left,
    #deckModal .deck-modal-content .modal-body .deck-modal-right,
    #deckModal .deck-modal-left,
    #deckModal .deck-modal-right {
        max-height: none !important;
        overflow-y: visible !important;
    }

    #deckModal .deck-modal-header-left h3 {
        font-size: 1rem;
    }

    #deckModal .deck-statistics-row {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    #deckModal .deck-statistics-row .rating-display {
        flex-direction: column;
        text-align: center;
    }

    #deckModal .youtube-embed-container {
        padding-bottom: 75%;
    }

    #deckModal .deck-modal-right .analytics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Footer stacks on mobile */
    #deckModal .deck-modal-footer {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    #deckModal .deck-modal-footer > * {
        flex: none;
        text-align: center !important;
    }

    .msa-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .msa-modal-body {
        padding: 15px 20px;
    }

    .traits-section,
    .effects-section {
        padding: 15px;
    }

    .trait-badge,
    .effect-badge {
        padding: 6px 10px;
    }

    .trait-badge-name,
    .effect-badge-name {
        font-size: 13px;
    }

    .trait-badge-count,
    .effect-badge-count {
        min-width: 20px;
        height: 20px;
        font-size: 11px;
    }

    .price-disclaimer {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    #deckModal .analytics-grid {
        grid-template-columns: 1fr;
    }

    #deckModal .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    #deckModal .card-quantity-badge {
        width: 24px;
        height: 24px;
        font-size: 12px;
        bottom: 38px;
    }

    #deckModal .card-uuid-label {
        font-size: 10px;
        padding: 4px 2px;
    }
}
