:root {
    /* SailPoint Brand Colors */
    --color-sp-navy: #012169;
    --color-sp-blue: #0066CC;
    --color-sp-light-blue: #4A90E2;
    --color-sp-orange: #FF6B35;
    --color-sp-light-orange: #FF8C61;
    --color-ice: #F5F8FA;
    --color-cream: #FFFFFF;
    --color-gray-light: #E8EDF2;
    --color-gray-medium: #8B9DAF;
    --color-gray-dark: #2C3E50;
    --color-success: #2ecc71;
    --color-warning: #f39c12;
    
    --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-card: 0 12px 48px rgba(26, 26, 46, 0.15);
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--color-ice);
    color: var(--color-gray-dark);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background decoration */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -20%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 102, 204, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--color-sp-navy);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* .logo::before {
  content: '';
  display: block;            
  width: 150px;
  height: 50px;
  margin-bottom:10px;
  background-image: url('SailPoint-Logo-RGB-inverse.png');
  background-size: contain;
  background-repeat: no-repeat; 
  background-position: left center; 
  flex: 0 0 auto;              
} */

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

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.btn-icon:active {
    transform: scale(0.95);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-success);
    box-shadow: 0 0 10px var(--color-success);
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.offline {
    background: var(--color-warning);
    box-shadow: 0 0 10px var(--color-warning);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Content */
.main {
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

/* View Headers */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.view-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-sp-navy);
}

/* Buttons */
.btn-primary {
    background: var(--color-sp-orange);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.2);
    transition: var(--transition-smooth);
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    background: var(--color-sp-light-orange);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: white;
    color: var(--color-sp-navy);
    border: 2px solid var(--color-sp-navy);
    padding: 10px 26px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-secondary:hover {
    background: var(--color-sp-navy);
    color: white;
}

/* Deck List */
.deck-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.deck-card {
    background: white;
    padding: 28px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(1, 33, 105, 0.1);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.deck-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-sp-orange);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.deck-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 33, 105, 0.15);
    border-color: var(--color-sp-blue);
}

.deck-card:hover::before {
    transform: scaleX(1);
}

.deck-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-sp-navy);
    margin-bottom: 12px;
}

.deck-stats {
    display: flex;
    gap: 20px;
    color: var(--color-gray-medium);
    font-size: 0.875rem;
}

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

.deck-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 5px;
    border: none;
    background: var(--color-gray-light);
    color: var(--color-sp-navy);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.btn-small:hover {
    background: var(--color-sp-navy);
    color: white;
}

.btn-small.disabled {
    background: var(--color-gray-light);
    color: var(--color-gray-medium);
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-small.disabled:hover {
    background: var(--color-gray-light);
    color: var(--color-gray-medium);
    transform: none;
}

/* Company Supplied Badge */
.company-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-sp-blue), var(--color-sp-light-blue));
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sync-badge {
    display: inline-block;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
    margin-left: 8px;
    cursor: help;
}

.deck-card.company-supplied {
    border-left: 3px solid var(--color-sp-blue);
}

/* Study View */
.study-view {
    max-width: 800px;
    margin: 0 auto;
}

.study-header {
    margin-bottom: 40px;
}

.btn-back {
    background: none;
    border: none;
    color: var(--color-sp-navy);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.btn-back:hover {
    background: rgba(1, 33, 105, 0.08);
}

.deck-info h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--color-sp-navy);
    margin-bottom: 8px;
}

.progress-info {
    color: var(--color-gray-medium);
    font-size: 1rem;
    font-weight: 500;
}

/* Flashcard */
.study-container {
    position: relative;
}

.flashcard {
    perspective: 1000px;
    margin-bottom: 40px;
    height: 400px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(1, 33, 105, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 36px;
    border: 2px solid var(--color-gray-light);
    overflow: hidden;
}

.card-back {
    transform: rotateY(180deg);
    background: var(--color-sp-navy);
    color: white;
    border-color: var(--color-sp-navy);
}

.card-content {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.5;
    max-height: 100%;
    overflow-y: auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    width: 100%;
    padding: 0 12px 32px 12px; /* Extra bottom padding for hint */
    
    /* Custom scrollbar for better appearance */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

/* Rich back content modes
   - default (text): uses existing .card-content styles
   - media: centres image/video/audio both horizontally and vertically, and fits within the card
   - html: allows richer markup while keeping scroll behaviour
*/
#cardBack.card-content--media {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;          /* override .card-content padding */
    overflow: hidden;    /* ensure media never overflows rounded card */
    text-align: center;
}

#cardBack.card-content--media img,
#cardBack.card-content--media video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px; /* match card rounding */
}

#cardBack.card-content--media audio {
    width: 100%;
    max-width: 520px;
}

#cardBack.card-content--html {
    text-align: left; /* nicer for paragraphs/lists; still centred by parent face */
}

#cardBack.card-content--html a {
    color: inherit;
    text-decoration: underline;
}

.card-content::-webkit-scrollbar {
    width: 6px;
}

.card-content::-webkit-scrollbar-track {
    background: transparent;
}

.card-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.card-back .card-content::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
}

.card-hint {
    position: absolute;
    bottom: 16px;
    font-size: 0.8rem;
    opacity: 0.5;
    font-style: italic;
    font-weight: 400;
    pointer-events: none;
}

/* Study Controls */
.study-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-response {
    flex: 1;
    max-width: 200px;
    padding: 18px 20px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    opacity: 0.7;
}

.flashcard.flipped ~ .study-controls .btn-response {
    opacity: 1;
    pointer-events: all;
}

.flashcard:not(.flipped) ~ .study-controls .btn-response {
    pointer-events: none;
}

.btn-wrong {
    background: linear-gradient(135deg, #DC3545, #C82333);
    color: white;
}

.btn-right {
    background: linear-gradient(135deg, #28A745, #218838);
    color: white;
}

.btn-response:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn-response:active {
    transform: scale(0.98);
}

.btn-key {
    font-size: 0.65rem;
    opacity: 0.4;
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 400;
}

/* Score Containers */
.score-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.score-badge {
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    border-radius: 50%;
    border: 4px solid;
    font-family: var(--font-display);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-wrong {
    color: #DC3545;
    border-color: #DC3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
}

.score-right {
    color: #28A745;
    border-color: #28A745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(40, 167, 69, 0.05));
}

/* Completion Message */
.completion-message {
    text-align: center;
    padding: 60px 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(1, 33, 105, 0.12);
    border: 2px solid var(--color-gray-light);
}

.completion-message h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--color-sp-navy);
    font-weight: 600;
}

.completion-message p {
    font-size: 1.1rem;
    color: var(--color-gray-medium);
    margin-bottom: 30px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 33, 105, 0.4);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(1, 33, 105, 0.2);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--color-gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--color-sp-navy);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--color-gray-medium);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    background: var(--color-gray-light);
    color: var(--color-sp-navy);
}

.modal-body {
    padding: 28px;
}

.modal-body label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-sp-navy);
    font-size: 0.9rem;
}

.modal-body input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-gray-light);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin-bottom: 20px;
    transition: var(--transition-smooth);
}

.modal-body input:focus {
    outline: none;
    border-color: var(--color-sp-blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.help-text {
    font-size: 0.85rem;
    color: var(--color-gray-medium);
}

.catalog-status {
    padding: 12px;
    border-radius: 6px;
    background: var(--color-ice);
    border: 1px solid var(--color-gray-light);
}

.catalog-status p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--color-gray-light);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(1, 33, 105, 0.2);
    padding: 20px 24px;
    z-index: 1000;
    max-width: 500px;
    width: 90%;
    transition: var(--transition-smooth);
    border: 2px solid var(--color-gray-light);
}

.install-prompt.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

.install-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.install-icon {
    font-size: 2rem;
}

.install-text strong {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-sp-navy);
}

.install-text p {
    font-size: 0.85rem;
    color: var(--color-gray-medium);
    margin: 0;
}

.btn-install {
    background: var(--color-sp-orange);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
    font-size: 0.9rem;
}

.btn-install:hover {
    background: var(--color-sp-light-orange);
}

.btn-dismiss {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-gray-medium);
    cursor: pointer;
    padding: 0 8px;
}

/* Update Notification */
.update-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(1, 33, 105, 0.2);
    padding: 16px 20px;
    z-index: 1000;
    transition: var(--transition-smooth);
    border: 2px solid var(--color-sp-blue);
}

.update-notification.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
}

.update-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-icon {
    font-size: 1.5rem;
}

.update-text {
    font-weight: 500;
    color: var(--color-sp-navy);
    font-size: 0.9rem;
}

.btn-update {
    background: var(--color-sp-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 0.85rem;
}

.btn-update:hover {
    background: var(--color-sp-light-blue);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo {
        font-size: 1.5rem;
    }
    
    .view-header h2 {
        font-size: 2rem;
    }
    
    .deck-list {
        grid-template-columns: 1fr;
    }
    
    .flashcard {
        height: 350px;
    }
    
    .card-front,
    .card-back {
        padding: 24px;
    }
    
    .card-content {
        font-size: 1.25rem;
    }
    
    .study-controls {
        flex-direction: column;
    }
    
    .btn-response {
        max-width: 100%;
    }
    
    .install-prompt {
        bottom: 10px;
        width: calc(100% - 20px);
    }
}

/* Extra responsive handling for very long text */
@media (max-height: 600px) {
    .flashcard {
        height: 300px;
    }
    
    .card-content {
        font-size: 1.1rem;
    }
}

@media (min-width: 1400px) {
    .flashcard {
        height: 450px;
    }
    
    .card-content {
        font-size: 1.6rem;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(90deg, var(--color-ice) 0%, var(--color-cream) 50%, var(--color-ice) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* ============================================================
   MOBILE RESPONSIVENESS (single, consolidated block)
   - Fixes header sizing/alignment
   - Tightens "Back to Decks" spacing
   - Makes Wrong/Right controls smaller and stable
   ============================================================ */

@media (max-width: 520px) {
    /* Overall density */
    .container {
        padding: 0 12px;
    }

    .main {
        padding: 18px 0;
    }

    /* -------- Header -------- */
    .header {
        padding: 10px 0;
    }

    .header .container {
        /* Keep it simple: allow wrap, shrink elements, avoid giant gaps */
        flex-wrap: wrap;
        gap: 10px 12px;
        align-items: center;
    }

    /* Make brand block compact */
    .logo {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;     /* logo graphic above title */
        align-items: flex-start;
        justify-content: center;
        gap: 6px;
        font-size: clamp(1.25rem, 5.2vw, 1.55rem);
        line-height: 1.05;
        text-align: left;
    }

    .logo::before {
        width: 110px;
        height: 28px;
        margin-bottom: 0;
        background-position: left center;
    }

    /* Actions stay on the same row, smaller buttons */
    .header-actions {
        flex: 0 0 auto;
        gap: 10px;
        align-items: center;
        justify-content: flex-end;
    }

    .btn-icon {
        padding: 8px;
        border-radius: 10px;
    }

    .btn-icon svg {
        width: 18px;
        height: 18px;
    }

    .status-indicator {
        width: 9px;
        height: 9px;
        box-shadow: 0 0 8px var(--color-success);
    }

    .status-indicator.offline {
        box-shadow: 0 0 8px var(--color-warning);
    }

    /* -------- Home view header -------- */
    .view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 18px;
    }

    .view-header h2 {
        font-size: 1.6rem;
    }

    .btn-primary {
        width: 100%;
        padding: 12px 18px;
    }

    /* Deck cards: tighten and allow wrapping */
    .deck-card {
        padding: 18px;
    }

    .deck-stats {
        flex-wrap: wrap;
        gap: 10px 14px;
    }

    .deck-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .btn-small {
        flex: 1 1 auto;
        min-width: 110px;
    }

    /* -------- Study header / Back link -------- */
    .study-header {
        margin-bottom: 14px;
    }

    .btn-back {
        margin-bottom: 8px;
        padding: 6px 8px;
        border-radius: 6px;
        font-size: 0.92rem;
        line-height: 1.1;
    }

    .deck-info h2 {
        font-size: 1.25rem;
        margin-bottom: 4px;
        line-height: 1.15;
    }

    .progress-info {
        font-size: 0.9rem;
    }

    /* -------- Card -------- */
    .flashcard {
        height: 300px;
        margin-bottom: 14px;
    }

    .card-front,
    .card-back {
        padding: 16px;
    }

    .card-content {
        font-size: 1.05rem;
        padding: 0 10px 22px 10px;
    }

    .card-hint {
        bottom: 12px;
        font-size: 0.75rem;
    }

    /* -------- Controls: smaller and stable -------- */
    .study-controls {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        justify-items: stretch;
    }

    /* Each score row is a grid so it never "messes up" */
    .score-container {
        width: 100%;
        display: grid;
        align-items: center;
        gap: 10px;
    }

    /* Wrong row: badge then button */
    .score-container:first-child {
        grid-template-columns: 48px 1fr;
    }

    /* Right row: button then badge */
    .score-container:last-child {
        grid-template-columns: 1fr 48px;
    }

    .score-badge {
        min-width: 48px;
        height: 48px;
        font-size: 1.2rem;
        border-width: 3px;
    }

    .btn-response {
        max-width: none;
        width: 100%;
        padding: 10px 12px;
        border-radius: 10px;
        font-size: 0.95rem;
        gap: 4px;
    }

    /* Key hints eat space on mobile; hide them */
    .btn-key {
        display: none;
    }

    /* Media backs: keep within card on mobile */
    #cardBack.card-content--media img,
    #cardBack.card-content--media video {
        max-width: 100%;
        max-height: 100%;
        border-radius: 10px;
    }

    #cardBack.card-content--media audio {
        max-width: 100%;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .flashcard {
        height: 280px;
    }

    .logo {
        font-size: clamp(1.15rem, 6vw, 1.4rem);
    }

    .logo::before {
        width: 96px;
        height: 24px;
    }

    .btn-response {
        padding: 9px 10px;
    }
}

/* ============================================================
   Mobile: single-row controls (badge + Wrong + Right + badge)
   ============================================================ */
@media (max-width: 520px) {
  /* Put everything on one line */
  .study-controls {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
  }

  /* Flatten the containers so badge+button participate in the same flex row */
  .score-container {
    display: contents !important;
  }

  /* Order: [wrong badge][wrong btn][right btn][right badge] */
  .score-badge.score-wrong { order: 1; }
  .btn-response.btn-wrong  { order: 2; }
  .btn-response.btn-right  { order: 3; }
  .score-badge.score-right { order: 4; }

  /* Smaller score circles (mobile only) */
  .score-badge {
    min-width: 44px;
    height: 44px;
    font-size: 1.15rem;
    border-width: 3px;
  }

  /* Slightly narrower/shorter buttons (mobile only) */
  .btn-response {
    flex: 1 1 auto;      /* buttons take remaining space */
    max-width: 150px;    /* keeps them from being huge */
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: 10px;
    gap: 0;
  }

  /* Hide key hints on mobile to save height */
  .btn-key {
    display: none;
  }
}

/* Very small phones: tighten a bit more */
@media (max-width: 380px) {
  .score-badge {
    min-width: 40px;
    height: 40px;
    font-size: 1.05rem;
  }

  .btn-response {
    max-width: 135px;
    padding: 9px 10px;
    font-size: 0.9rem;
  }
}

/* ============================================================
   Mobile: tidy up "Deck Complete" panel
   ============================================================ */
@media (max-width: 520px) {
  .completion-message {
    padding: 28px 18px;
    border-radius: 12px;
  }

  .completion-message h3 {
    font-size: 1.45rem;
    margin-bottom: 10px;
    line-height: 1.15;
  }

  .completion-message p {
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.4;
  }

  /* Make the stats line compact and single-line */
/* Make the stats line compact without hiding values */
#completionStats {
  display: block;
  font-size: 0.92rem;
  line-height: 1.25;
  white-space: normal;   /* allow wrap if needed */
  overflow: visible;     /* do NOT hide tail */
}

  /* If you keep emojis in the string, scale them down a touch */
  #completionStats .emoji,
  #completionStats span {
    font-size: 0.92rem;
  }

  /* Optional: button slightly shorter on mobile */
  #restartButton,
  .completion-message .btn-primary,
  .completion-message .btn-secondary {
    padding: 12px 16px;
    font-size: 0.95rem;
    border-radius: 8px;
  }
}

/* Extra small phones */
@media (max-width: 380px) {
  .completion-message {
    padding: 24px 16px;
  }

  .completion-message h3 {
    font-size: 1.3rem;
  }

  #completionStats {
    font-size: 0.88rem;
  }
}

.header .container { position: relative; }

.header-version{
  position: absolute;
  right: 10px;
  bottom: 6px;
  font: 8px Arial, sans-serif;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.2px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.app-version{
  position: fixed;
  right: 10px;
  bottom: 8px;
  font: 8px Arial, sans-serif;
  color: rgba(44, 62, 80, 0.55); /* subtle on light bg */
  line-height: 1;
  letter-spacing: 0.2px;
  z-index: 2000;
  pointer-events: none;
  user-select: none;
}

/* If you ever show a dark full-screen modal, keep it readable */
.modal:not(.hidden) ~ .app-version{
  color: rgba(255,255,255,0.7);
}




:root{
  --footerbar-height: 18px;
}

/* Make room for the fixed footer bar */
body{
  padding-bottom: var(--footerbar-height);
}

/* Thin blue bar pinned to the bottom */
.app-footerbar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--footerbar-height);
  background: var(--color-sp-navy);
  z-index: 2000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.12);
}

/* Align content to the right with same container width */
.app-footerbar__inner{
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Version text styling */
.app-footerbar__version{
  font: 8px Arial, sans-serif;
  color: rgba(255,255,255,0.85);
  line-height: 1;
  letter-spacing: 0.2px;
  user-select: none;
  pointer-events: none;
}

/* Mobile: match your tighter container padding */
@media (max-width: 520px){
  .app-footerbar__inner{ padding: 0 12px; }
}