/* Vokio - Custom Styles @version 2.18.0 */

/* =====================================================
   Self-hosted Fonts
   ===================================================== */
@font-face {
    font-family: 'Galindo';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Galindo-Regular.woff2') format('woff2');
}

/* =====================================================
   Vokio Pastel Palette
   Soft, muted tones used site-wide for consistency.
   ===================================================== */
:root {
    /* Layout */
    --bs-body-bg: #ffffff;
    --bs-body-color: #212529;
    --bs-secondary-bg: #f8f9fa;
    --bs-tertiary-bg: #e9ecef;
    --bs-border-color: #dee2e6;
    --card-bg: #ffffff;
    --navbar-bg: #f8f9fa;
    --navbar-brand-color: #212529;
    --input-bg: #ffffff;
    --input-border: #ced4da;
    --shadow-color: rgba(0, 0, 0, 0.125);

    /* Vokio palette - pastel */
    --t-primary: #7c9cbf;
    --t-primary-hover: #6889ad;
    --t-primary-bg: #e8eff6;
    --t-primary-text: #4a6a8a;
    --t-success: #7bbf7e;
    --t-success-hover: #6aad6d;
    --t-success-bg: #e4f3e5;
    --t-success-border: #a8d5aa;
    --t-success-text: #3d7a3f;
    --t-danger: #cf8a8a;
    --t-danger-hover: #c07878;
    --t-danger-bg: #f5e2e2;
    --t-danger-border: #dbb0b0;
    --t-danger-text: #8a4a4a;
    --t-warning: #d4a94b;
    --t-warning-hover: #c49a3e;
    --t-warning-bg: #faf0d8;
    --t-warning-border: #e0c882;
    --t-warning-text: #7a6020;
    --t-info: #6ab0c4;
    --t-info-hover: #5a9eb2;
    --t-info-bg: #e0f0f5;
    --t-info-border: #a0d0de;
    --t-info-text: #3a707e;
    --t-muted: #9ca8b5;
    --t-muted-bg: #edf0f3;
    --t-dark: #6b7a8a;
    --t-dark-hover: #5a6978;
}

[data-bs-theme="dark"] {
    /* Layout */
    --bs-body-bg: #1a1d20;
    --bs-body-color: #e9ecef;
    --bs-secondary-bg: #2b3035;
    --bs-tertiary-bg: #343a40;
    --bs-border-color: #495057;
    --card-bg: #2b3035;
    --navbar-bg: #212529;
    --navbar-brand-color: #ffffff;
    --input-bg: #2b3035;
    --input-border: #495057;
    --shadow-color: rgba(0, 0, 0, 0.5);

    /* Vokio palette - pastel (dark mode) */
    --t-primary: #7c9cbf;
    --t-primary-hover: #90b0cf;
    --t-primary-bg: #2a3a4a;
    --t-primary-text: #a8c4e0;
    --t-success: #7bbf7e;
    --t-success-hover: #8ecc90;
    --t-success-bg: #253a26;
    --t-success-border: #4a7a4c;
    --t-success-text: #a0d4a2;
    --t-danger: #cf8a8a;
    --t-danger-hover: #daa0a0;
    --t-danger-bg: #3d2828;
    --t-danger-border: #8a5050;
    --t-danger-text: #e0b0b0;
    --t-warning: #d4a94b;
    --t-warning-hover: #e0ba60;
    --t-warning-bg: #3d3420;
    --t-warning-border: #8a7030;
    --t-warning-text: #e0c882;
    --t-info: #6ab0c4;
    --t-info-hover: #80c2d4;
    --t-info-bg: #1e3540;
    --t-info-border: #3a707e;
    --t-info-text: #a0d0de;
    --t-muted: #7a8694;
    --t-muted-bg: #2b3035;
    --t-dark: #8a96a4;
    --t-dark-hover: #9aa6b4;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bs-border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary-color, #6c757d);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bs-border-color) transparent;
}

/* Global Styles */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

/* Three-panel layout: header | content | footer */
#site-header {
    flex: 0 0 auto;
}

#site-content {
    flex: 1 1 auto;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

#site-footer {
    flex: 0 0 auto;
}

/* Card Enhancements */
.card {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background-color: var(--card-bg);
    box-shadow: 0 0.125rem 0.25rem var(--shadow-color);
}

.card-header {
    border-bottom: 1px solid var(--bs-border-color);
    border-radius: 0.5rem 0.5rem 0 0 !important;
    font-weight: 600;
    background-color: var(--bs-secondary-bg);
}

/* Subtle admin page headers */
.card-header.bg-primary {
    background: linear-gradient(135deg, var(--t-primary), var(--t-primary-hover)) !important;
    border-color: var(--t-primary-hover) !important;
    color: white !important;
}

[data-bs-theme="dark"] .card-header.bg-primary {
    background: linear-gradient(135deg, var(--t-dark), var(--t-dark-hover)) !important;
    border-color: var(--t-dark) !important;
    color: white !important;
}

.card-body {
    background-color: var(--card-bg);
}

/* Button Enhancements - Pastel Overrides */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--t-primary);
    border-color: var(--t-primary);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active {
    background-color: var(--t-primary-hover);
    border-color: var(--t-primary-hover);
    color: #fff;
}
.btn-check:checked + .btn-primary {
    background-color: var(--t-primary-hover);
    border-color: var(--t-primary-hover);
}

.btn-success {
    background-color: var(--t-success);
    border-color: var(--t-success);
    color: #fff;
}
.btn-success:hover, .btn-success:focus, .btn-success:active {
    background-color: var(--t-success-hover);
    border-color: var(--t-success-hover);
    color: #fff;
}

.btn-danger {
    background-color: var(--t-danger);
    border-color: var(--t-danger);
    color: #fff;
}
.btn-danger:hover, .btn-danger:focus, .btn-danger:active {
    background-color: var(--t-danger-hover);
    border-color: var(--t-danger-hover);
    color: #fff;
}

.btn-warning {
    background-color: var(--t-warning);
    border-color: var(--t-warning);
    color: #fff;
}
.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background-color: var(--t-warning-hover);
    border-color: var(--t-warning-hover);
    color: #fff;
}

.btn-info {
    background-color: var(--t-info);
    border-color: var(--t-info);
    color: #fff;
}
.btn-info:hover, .btn-info:focus, .btn-info:active {
    background-color: var(--t-info-hover);
    border-color: var(--t-info-hover);
    color: #fff;
}

.btn-secondary {
    background-color: var(--t-muted);
    border-color: var(--t-muted);
    color: #fff;
}
.btn-secondary:hover, .btn-secondary:focus, .btn-secondary:active {
    background-color: var(--t-dark);
    border-color: var(--t-dark);
    color: #fff;
}

.btn-outline-primary {
    color: var(--t-primary);
    border-color: var(--t-primary);
}
.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active, .btn-outline-primary.active {
    background-color: var(--t-primary);
    border-color: var(--t-primary);
    color: #fff;
}

.btn-outline-success {
    color: var(--t-success);
    border-color: var(--t-success);
}
.btn-outline-success:hover, .btn-outline-success:focus {
    background-color: var(--t-success);
    border-color: var(--t-success);
    color: #fff;
}

.btn-outline-danger {
    color: var(--t-danger);
    border-color: var(--t-danger);
}
.btn-outline-danger:hover, .btn-outline-danger:focus {
    background-color: var(--t-danger);
    border-color: var(--t-danger);
    color: #fff;
}

.btn-outline-warning {
    color: var(--t-warning);
    border-color: var(--t-warning);
}
.btn-outline-warning:hover, .btn-outline-warning:focus {
    background-color: var(--t-warning);
    border-color: var(--t-warning);
    color: #fff;
}

.btn-outline-info {
    color: var(--t-info);
    border-color: var(--t-info);
}
.btn-outline-info:hover, .btn-outline-info:focus {
    background-color: var(--t-info);
    border-color: var(--t-info);
    color: #fff;
}

.btn-outline-secondary {
    color: var(--t-muted);
    border-color: var(--t-muted);
}
.btn-outline-secondary:hover, .btn-outline-secondary:focus, .btn-outline-secondary.active {
    background-color: var(--t-muted);
    border-color: var(--t-muted);
    color: #fff;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* Form Enhancements */
.form-control {
    border-radius: 0.375rem;
    border: 2px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--bs-body-color);
}

.form-control:focus {
    border-color: var(--t-primary);
    box-shadow: 0 0 0 0.2rem rgba(124, 156, 191, 0.25);
    background-color: var(--input-bg);
}

.form-control::placeholder {
    color: var(--bs-secondary-color);
}

.form-select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--bs-body-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Navigation */
.navbar {
    background-color: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--bs-border-color);
}

.navbar-brand {
    font-family: 'Galindo', cursive;
    font-weight: 400;
    font-size: 1.5rem;
    color: #ff6b00 !important;
}

.navbar-brand .badge {
    font-family: var(--bs-body-font-family);
}

.vokio-version-badge {
    font-family: var(--bs-body-font-family);
    font-size: 0.55rem;
    font-weight: 400;
    color: var(--bs-secondary-color);
    vertical-align: super;
    letter-spacing: 0.02em;
}

.vokio-changelog-btn {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    opacity: 0.5;
    text-decoration: none;
    transition: opacity 0.15s;
}

.vokio-changelog-btn:hover {
    opacity: 1;
    color: var(--t-primary);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--bs-body-color) !important;
}

.navbar-nav .nav-link:hover {
    color: var(--t-primary) !important;
}

.navbar-toggler {
    border-color: var(--bs-border-color);
}

.dropdown-menu {
    background-color: var(--card-bg);
    border-color: var(--bs-border-color);
    box-shadow: 0 0.5rem 1rem var(--shadow-color);
}

.dropdown-item {
    color: var(--bs-body-color);
}

.dropdown-item:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
}

/* Admin Tab Bar */
.admin-tabs {
    border-radius: 0.5rem;
}

.admin-tabs > .btn,
.admin-tabs > a.btn {
    flex: 1 1 0;
    border-radius: 0;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

.admin-tabs > .btn:first-child {
    border-radius: 0.5rem 0 0 0.5rem;
}

.admin-tabs > .btn.admin-tab-last {
    border-radius: 0 0.5rem 0.5rem 0;
}

.admin-tabs-dropdown {
    z-index: 1050;
}

/* Small qualifier badge inside a card heading ("Master Only"). Sized down so
   it reads as an annotation on the heading rather than competing with it. */
.badge-role-note {
    font-size: 0.6em;
}

/* Test-email address field - capped so it can't squeeze the Send Test button */
.test-email-input {
    max-width: 260px;
}

.admin-tabs .btn.active {
    background-color: var(--bs-body-color);
    border-color: var(--bs-body-color);
    color: var(--bs-body-bg);
}

@media (max-width: 768px) {
    .admin-tabs {
        flex-direction: column;
    }
    .admin-tabs > .btn {
        flex: unset;
        border-radius: 0 !important;
        border-bottom: 0;
    }
    .admin-tabs > .btn:first-child {
        border-radius: 0.5rem 0.5rem 0 0 !important;
    }
    .admin-tabs > .btn.admin-tab-last {
        border-radius: 0 0 0.5rem 0.5rem !important;
        border-bottom: 1px solid;
    }
}

/* Alert Enhancements */
.alert {
    border: none;
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--t-success);
    background-color: var(--t-success-bg);
    color: var(--t-success-text);
}

.alert-danger {
    border-left-color: var(--t-danger);
    background-color: var(--t-danger-bg);
    color: var(--t-danger-text);
}

.alert-info {
    border-left-color: var(--t-info);
    background-color: var(--t-info-bg);
    color: var(--t-info-text);
}

.alert-warning {
    border-left-color: var(--t-warning);
    background-color: var(--t-warning-bg);
    color: var(--t-warning-text);
}

/* Statistics Cards - Admin Dashboard (pastel gradients) */
.card[class*="stats-card-"] {
    border: none !important;
    color: white !important;
}

.card[class*="stats-card-"] .card-body {
    background: transparent !important;
    color: inherit !important;
}

.card.stats-card-primary {
    background: linear-gradient(135deg, var(--t-primary), var(--t-primary-hover)) !important;
    box-shadow: 0 4px 6px rgba(124, 156, 191, 0.3) !important;
}

.card.stats-card-success {
    background: linear-gradient(135deg, var(--t-success), var(--t-success-hover)) !important;
    box-shadow: 0 4px 6px rgba(123, 191, 126, 0.3) !important;
}

.card.stats-card-info {
    background: linear-gradient(135deg, var(--t-info), var(--t-info-hover)) !important;
    box-shadow: 0 4px 6px rgba(106, 176, 196, 0.3) !important;
}

.card.stats-card-warning {
    background: linear-gradient(135deg, var(--t-warning), var(--t-warning-hover)) !important;
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(212, 169, 75, 0.3) !important;
}

.card.stats-card-dark {
    background: linear-gradient(135deg, var(--t-dark), var(--t-dark-hover)) !important;
    box-shadow: 0 4px 6px rgba(107, 122, 138, 0.3) !important;
}

/* Word Cloud Container */
#wordCloudContainer {
    min-height: 400px;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background-color: #f8f9fa;
}

[data-bs-theme="dark"] #wordCloudContainer {
    background-color: #343a40;
}

#wordCloudContainer canvas {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    background-color: transparent !important;
}

[data-bs-theme="dark"] #wordCloudContainer canvas {
    background-color: transparent !important;
}

/* Table Enhancements */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

/* Maintain rounded corners without overflow: hidden */
.table thead tr:first-child th:first-child {
    border-top-left-radius: 0.5rem;
}

.table thead tr:first-child th:last-child {
    border-top-right-radius: 0.5rem;
}

.table tbody tr:last-child td:first-child,
.table tbody tr:last-child th:first-child {
    border-bottom-left-radius: 0.5rem;
}

.table tbody tr:last-child td:last-child,
.table tbody tr:last-child th:last-child {
    border-bottom-right-radius: 0.5rem;
}

.table th {
    border-top: none;
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

[data-bs-theme="dark"] .table th {
    background-color: #343a40;
    color: #e9ecef;
    border-bottom-color: var(--bs-border-color);
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: var(--t-primary-bg);
}

/* Footer */
footer {
    border-top: 1px solid var(--bs-border-color);
    background-color: var(--bs-body-bg);
}

.footer-legal-link {
    color: var(--bs-secondary-color);
    text-decoration: none;
}

.footer-legal-link:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* Utility text colour overrides */
.text-warning {
    color: var(--t-warning) !important;
}

.text-danger {
    color: var(--t-danger) !important;
}

.text-success {
    color: var(--t-success) !important;
}

.text-info {
    color: var(--t-info) !important;
}

.text-primary {
    color: var(--t-primary) !important;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.5rem 0.5rem 0 0;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 0.5rem 0.5rem;
}

/* List Group Enhancements */
.list-group-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Badge Enhancements */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.badge.bg-primary, .bg-primary {
    background-color: var(--t-primary) !important;
}

.badge.bg-success, .bg-success {
    background-color: var(--t-success) !important;
}

.badge.bg-danger, .bg-danger {
    background-color: var(--t-danger) !important;
}

.badge.bg-warning, .bg-warning {
    background-color: var(--t-warning) !important;
    color: #fff !important;
}

.badge.bg-info, .bg-info {
    background-color: var(--t-info) !important;
}

.badge.bg-secondary, .bg-secondary {
    background-color: var(--t-muted) !important;
}

/* Border colour overrides */
.border-primary { border-color: var(--t-primary) !important; }
.border-success { border-color: var(--t-success-border) !important; }
.border-danger { border-color: var(--t-danger-border) !important; }
.border-warning { border-color: var(--t-warning-border) !important; }
.border-info { border-color: var(--t-info-border) !important; }

/* Focus States */
button:focus,
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(124, 156, 191, 0.25);
}

.nav-link:focus,
.dropdown-toggle:focus,
.user-menu-toggle:focus {
    outline: none;
    box-shadow: none;
}

.dropdown-item:focus {
    outline: none;
    box-shadow: none;
}

/* Dark Mode Specific Adjustments */
[data-bs-theme="dark"] .table {
    --bs-table-bg: var(--card-bg);
    --bs-table-color: var(--bs-body-color);
}

[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] .list-group-item {
    background-color: var(--card-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--card-bg);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .modal-header {
    border-bottom-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .modal-footer {
    border-top-color: var(--bs-border-color);
}

[data-bs-theme="dark"] footer {
    background-color: var(--navbar-bg) !important;
    border-top-color: var(--bs-border-color);
}

/* User Menu Avatar */
.user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.user-avatar-lg {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
}

.user-menu-toggle {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

.user-dropdown {
    min-width: 220px;
}

.user-dropdown .dropdown-header {
    white-space: normal;
}

.user-dropdown .dropdown-item:hover,
.user-dropdown .dropdown-item:focus {
    background-color: var(--bs-tertiary-bg);
}

.user-dropdown .dropdown-item.active {
    background-color: var(--bs-secondary-bg);
    color: var(--t-primary);
    font-weight: 600;
}

/* =====================================================
   Tags (outlined badges with subtle fill)
   ===================================================== */

.tag {
    display: inline-block;
    padding: 0.2em 0.55em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    border-radius: 0.35em;
    border: 1px solid;
    vertical-align: middle;
}

.tag-primary {
    color: #4a90d9;
    background-color: rgba(74, 144, 217, 0.1);
    border-color: rgba(74, 144, 217, 0.4);
}

.tag-info {
    color: #0dcaf0;
    background-color: rgba(13, 202, 240, 0.1);
    border-color: rgba(13, 202, 240, 0.4);
}

.tag-success {
    color: #47b881;
    background-color: rgba(71, 184, 129, 0.1);
    border-color: rgba(71, 184, 129, 0.4);
}

.tag-danger {
    color: #e05252;
    background-color: rgba(224, 82, 82, 0.1);
    border-color: rgba(224, 82, 82, 0.4);
}

.tag-secondary {
    color: #8a929a;
    background-color: rgba(138, 146, 154, 0.1);
    border-color: rgba(138, 146, 154, 0.4);
}

.tag-warning {
    color: #e0a800;
    background-color: rgba(224, 168, 0, 0.1);
    border-color: rgba(224, 168, 0, 0.4);
}

/* Activity Type Tag */
.activity-type-tag {
    background-color: var(--t-primary-bg) !important;
    border-color: var(--t-primary) !important;
    color: var(--t-primary-text);
    font-weight: 600;
    cursor: default;
    user-select: none;
}

/* Larger form switches */
.form-switch.form-switch-lg {
    display: flex;
    align-items: center;
}
.form-switch.form-switch-lg .form-check-input {
    width: 3em;
    height: 1.5em;
    margin-top: 0;
}
.form-switch.form-switch-lg .form-check-label {
    margin-left: 0.5em;
}

/* Question Navigation Dropdown */
.question-nav-btn {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.question-nav-menu {
    max-height: 300px;
    overflow-y: auto;
}

/* Question Image Panel */
.question-image-panel {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 150px;
}

.image-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
    color: var(--bs-secondary-color);
    font-size: 1.5rem;
    padding: 1rem;
    text-align: center;
}

.image-drop-zone:hover {
    color: var(--t-primary);
    border-color: var(--t-primary);
}

.question-image-preview {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.375rem;
}

.question-image-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
}

.question-image-preview:hover .question-image-actions {
    opacity: 1;
}

/* Join Screen */
.join-screen {
    max-width: 420px;
    margin: 0 auto;
    padding-top: 10vh;
}

.join-icon {
    font-size: 4rem;
    color: var(--t-primary);
}

.code-input {
    font-size: 2rem;
    text-align: center;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.75rem;
}

.code-input::placeholder {
    letter-spacing: 0.2rem;
    font-weight: 400;
    font-size: 1.2rem;
}

/* QR Scanner */
#qr-scanner-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
#qr-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.qr-viewfinder {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 3px solid rgba(255, 255, 255, 0.7);
    border-radius: 1rem;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    pointer-events: none;
}
.qr-zoom-controls {
    position: fixed;
    bottom: 5.5rem;
    left: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem 1.25rem;
    border-radius: 2rem;
    z-index: 10000;
    color: #fff;
}
.qr-zoom-controls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    outline: none;
}
.qr-zoom-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}
.qr-zoom-controls i {
    font-size: 1.3rem;
    flex-shrink: 0;
}
.qr-close-btn {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    border-radius: 2rem;
    padding: 0.5rem 1.5rem;
    opacity: 0.9;
}

/* Quiz Player */
.quiz-screen {
    max-width: 640px;
    margin: 0 auto;
}

.quiz-hero-icon {
    font-size: 4rem;
    color: var(--t-primary);
}

.quiz-hero-icon.text-warning {
    color: var(--t-warning) !important;
}

.quiz-lobby-content {
    padding-top: 10vh;
}

.quiz-question-image {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 0.5rem;
    cursor: zoom-in;
}

img.lightbox-trigger {
    cursor: zoom-in !important;
}

/* Lightbox overlay */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: zoom-out;
}

.lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
    cursor: grab;
}

.lightbox-img:active {
    cursor: grabbing;
}

.lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 10000;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-hint {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

/* Quiz answer buttons */
.quiz-answer-btn {
    position: relative;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
    transition: transform 0.15s, background-color 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.quiz-answer-btn:focus:not(.quiz-selected),
.quiz-answer-btn:focus-visible:not(.quiz-selected) {
    color: inherit;
    background-color: transparent;
    box-shadow: none;
}

.quiz-answer-btn:not(:disabled):hover {
    transform: translateX(4px);
    background-color: var(--t-primary-bg);
    border-color: var(--t-primary);
}

.quiz-answer-btn:disabled {
    opacity: 0.9;
}

.quiz-answer-btn.quiz-correct {
    background-color: var(--t-success-bg);
    border-color: var(--t-success-border);
    color: var(--t-success-text);
}

.quiz-answer-btn.quiz-wrong {
    background-color: var(--t-danger-bg);
    border-color: var(--t-danger-border);
    color: var(--t-danger-text);
}

.quiz-answer-btn.quiz-selected {
    background-color: var(--t-primary-bg);
    border-color: var(--t-primary);
    color: var(--t-primary-text);
}

.quiz-answer-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--bs-tertiary-bg);
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.quiz-answer-btn.quiz-correct .quiz-answer-letter {
    background-color: var(--t-success);
    color: #fff;
}

.quiz-answer-btn.quiz-wrong .quiz-answer-letter {
    background-color: var(--t-danger);
    color: #fff;
}

.quiz-answer-btn.quiz-selected .quiz-answer-letter {
    background-color: var(--t-primary);
    color: #fff;
}

/* Quiz badges */
.quiz-badge-muted {
    background-color: var(--t-muted-bg);
    color: var(--t-muted);
}

.quiz-badge-timer {
    background-color: var(--t-warning-bg);
    color: var(--t-warning);
}

.quiz-badge-timer.quiz-urgent {
    background-color: var(--t-danger-bg);
    color: var(--t-danger);
}

/* Quiz progress bar */
#quiz-app .progress {
    background-color: var(--t-muted-bg);
}

#quiz-app .progress-bar {
    background-color: var(--t-primary);
}

#quiz-app #quiz-score-bar {
    background-color: var(--t-success);
}

/* Quiz results review cards */
#quiz-review .card.border-success {
    border-color: var(--t-success-border) !important;
}

#quiz-review .card.border-danger {
    border-color: var(--t-danger-border) !important;
}

/* =====================================================
   Presenter / Host View
   Full-screen slideshow for classroom projection.
   ===================================================== */
.host-body {
    background: #1a1d20;
    color: #e9ecef;
    overflow: hidden;
    height: 100vh;
    cursor: pointer;
    user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.host-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: rgba(0, 0, 0, 0.4);
    font-size: 0.85rem;
}

.host-activity-name {
    color: #7a8694;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}

.host-progress {
    background: #2a3a4a;
    color: #a8c4e0;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.8rem;
}

.host-votes {
    background: #1e3540;
    color: #a0d0de;
    padding: 0.2rem 0.6rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    margin-left: auto;
}

.host-exit-btn {
    background: none;
    border: none;
    color: #7a8694;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 0.25rem;
    transition: color 0.2s, background 0.2s;
}

.host-exit-btn:hover {
    color: #e0b0b0;
    background: rgba(207, 138, 138, 0.15);
}

/* Restart button */
.host-restart-btn {
    background: none;
    border: 1px solid #5a6370;
    color: #9da5af;
    font-size: 0.85rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    border-radius: 0.25rem;
    margin-right: 0.5rem;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.host-restart-btn:hover {
    color: #f0c674;
    border-color: #f0c674;
    background: rgba(240, 198, 116, 0.1);
}

/* JIP (Join In Progress) overlay */
.host-jip {
    position: fixed;
    bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(26, 29, 32, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
    z-index: 100;
    backdrop-filter: blur(8px);
    transition: left 0.3s ease, right 0.3s ease, transform 0.3s ease;
}
.host-jip.jip-left {
    left: 1.5rem;
    right: auto;
    transform: none;
}
.host-jip.jip-center {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}
.host-jip.jip-right {
    left: auto;
    right: 1.5rem;
    transform: none;
}
.host-jip-qr {
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 10px;
    line-height: 0;
}
.host-jip-qr img,
.host-jip-qr canvas {
    display: block;
    border-radius: 4px;
}
.host-jip-code {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: #e9ecef;
}

/* QR toggle button - bottom-right corner of present screen */
.host-jip-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 101;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    background: rgba(26, 29, 32, 0.7);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    padding: 0;
}
.host-jip-toggle:hover {
    color: #ffffff;
    background: rgba(26, 29, 32, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Main stage */
.host-stage {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 2.75rem 2.5rem 2.5rem;
    box-sizing: border-box;
    overflow: hidden;
}

.host-question-text {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0;
    line-height: 1.3;
    color: #e9ecef;
    flex-shrink: 0;
}

/* Split layout: image left, answers right */
.host-split {
    display: flex;
    gap: 2rem;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

.host-split-image {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
}

.host-split-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.75rem;
}

.host-split-answers {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    min-width: 0;
}

.host-split-answers .host-answers {
    grid-template-columns: 1fr;
    width: 100%;
}

/* Answer grid (full width when no image) */
.host-answers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    flex: 1 1 auto;
    align-content: center;
}

.host-answer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 500;
    transition: opacity 0.4s, transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.host-answer-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Neutral state - each answer gets a distinct muted colour */
.host-answer.host-a { background: #2a3a4a; color: #a8c4e0; }
.host-answer.host-a .host-answer-letter { background: #3a5068; color: #c0d8f0; }

.host-answer.host-b { background: #3d2828; color: #e0b0b0; }
.host-answer.host-b .host-answer-letter { background: #5a3838; color: #f0c8c8; }

.host-answer.host-c { background: #3d3420; color: #e0c882; }
.host-answer.host-c .host-answer-letter { background: #5a4e30; color: #f0d898; }

.host-answer.host-d { background: #253a26; color: #a0d4a2; }
.host-answer.host-d .host-answer-letter { background: #3a5a3c; color: #b8e0ba; }

.host-answer.host-e { background: #1e3540; color: #a0d0de; }
.host-answer.host-e .host-answer-letter { background: #2e4a58; color: #b8e0ee; }

.host-answer.host-f { background: #352a40; color: #c0a8d8; }
.host-answer.host-f .host-answer-letter { background: #4a3a5a; color: #d0b8e8; }

/* Revealed: correct */
.host-answer.host-correct {
    background: #253a26;
    box-shadow: inset 0 0 20px rgba(123, 191, 126, 0.2);
    transform: scale(1.02);
}

.host-answer.host-correct .host-answer-letter {
    background: #7bbf7e;
    color: #fff;
}

.host-answer.host-correct .host-answer-text {
    color: #a0d4a2;
}

.host-answer.host-correct::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 1.25rem;
    color: #7bbf7e;
}

/* Answer stats (percentage + bar) on reveal */
.host-answer {
    position: relative;
    overflow: hidden;
}

.host-answer-stats {
    margin-left: auto;
    font-weight: 700;
    font-size: 1.1rem;
    z-index: 1;
    flex-shrink: 0;
}

.host-answer-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    transition: width 0.6s ease;
    z-index: 0;
}

.host-answer.host-correct .host-answer-bar {
    background: rgba(123, 191, 126, 0.15);
}

.host-answer > * {
    position: relative;
    z-index: 1;
}

/* Revealed: wrong */
.host-answer.host-wrong {
    opacity: 0.35;
    transform: scale(0.98);
}

/* Complete screen */
.host-complete {
    text-align: center;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.host-complete-icon {
    font-size: 4rem;
    color: #d4a94b;
    margin-bottom: 1rem;
}

.host-complete h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.host-complete p {
    color: #7a8694;
    font-size: 1.1rem;
}

/* Host lobby slide */
.host-lobby {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.host-lobby-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #e9ecef;
}

.host-lobby-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.host-lobby-qr {
    background: #ffffff;
    padding: 1rem;
    border-radius: 1rem;
}

.host-lobby-info {
    text-align: center;
}

.host-lobby-code-label {
    font-size: 1rem;
    color: #7a8694;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.host-lobby-code {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 0.5rem;
    color: #e9ecef;
    margin-bottom: 0.5rem;
}

.host-lobby-url {
    color: #5a6978;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.host-lobby-players {
    font-size: 1.2rem;
    color: #a0d0de;
}

/* Leaderboard */
.host-leaderboard {
    margin-top: 1.5rem;
    width: 100%;
    max-width: 500px;
}

.host-leaderboard h4 {
    color: #7a8694;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.host-leaderboard-list {
    text-align: left;
}

.host-leaderboard-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
}

.host-leaderboard-row:nth-child(1) {
    background: rgba(212, 169, 75, 0.15);
    font-size: 1.2rem;
}

.host-leaderboard-row:nth-child(2) {
    background: rgba(156, 168, 181, 0.1);
    font-size: 1.1rem;
}

.host-leaderboard-row:nth-child(3) {
    background: rgba(106, 176, 196, 0.1);
}

.host-lb-rank {
    width: 28px;
    text-align: center;
    font-weight: 700;
    color: #7a8694;
}

.host-lb-icon {
    font-size: 1.1rem;
}

.host-lb-name {
    flex: 1;
    color: #e9ecef;
    font-weight: 500;
}

.host-lb-score {
    font-weight: 700;
    color: #a0d4a2;
}

@media (max-width: 768px) {
    .host-lobby-content {
        flex-direction: column;
        gap: 1.5rem;
    }

    .host-lobby-code {
        font-size: 2.5rem;
    }
}

/* Bottom hint bar */
.host-hint {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.4);
    color: #5a6978;
    font-size: 0.75rem;
}

/* Plan cap banner (M3) - sits just above .host-hint, host screen only.
   Deliberately quiet: this is a presenter-side nudge before an event, not an
   alert during one, and it must never compete with the activity on a projector. */
.host-plan-banner {
    position: fixed;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0.4rem 0.75rem;
    color: #5a6978;
    font-size: 0.75rem;
    pointer-events: none;
}

.host-plan-banner-warn {
    color: #d9a441;
}

.host-hint kbd {
    background: #2b3035;
    border: 1px solid #495057;
    border-radius: 0.2rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.7rem;
    color: #7a8694;
}

/* Responsive */
@media (max-width: 768px) {
    .host-answers {
        grid-template-columns: 1fr;
    }

    .host-split {
        flex-direction: column;
        gap: 1rem;
    }

    .host-split-image {
        flex: 0 0 auto;
        max-height: 35vh;
    }

    .host-stage {
        padding: 3rem 1rem 3rem;
    }
}

/* =====================================================
   WebSocket Reconnect Indicator (live quiz / host)
   ===================================================== */
.ws-status-indicator {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    background: #ffc107;
    color: #1a1d20;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: none;
    pointer-events: none;
}
.ws-status-indicator.ws-error {
    background: #dc3545;
    color: #fff;
}
.ws-status-indicator .fa-spinner {
    margin-right: 6px;
}

/* =====================================================
   Live Player View (play.php in live mode)
   ===================================================== */
.play-screen {
    max-width: 480px;
    margin: 0 auto;
}

.play-nickname-content,
.play-waiting-content,
.play-locked-content,
.play-result-content,
.play-ended-content {
    padding-top: 15vh;
}

.play-answer-btn {
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    transition: transform 0.1s, opacity 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.play-answer-btn:focus:not(.active),
.play-answer-btn:focus-visible:not(.active) {
    color: inherit;
    background-color: transparent;
    box-shadow: none;
}

/* iOS sticky :hover fix - prevent Bootstrap outline fill on touch devices */
@media (hover: none) {
    .play-answer-btn:not(:active):not(.active) {
        background-color: var(--bs-btn-bg) !important;
        color: var(--bs-btn-color) !important;
        border-color: var(--bs-btn-border-color) !important;
    }
}

.play-answer-btn:not(:disabled):active {
    transform: scale(0.97);
}

.play-answer-btn.active {
    opacity: 1;
    font-weight: 600;
}

.play-answer-btn:disabled:not(.active) {
    opacity: 0.5;
}

/* =====================================================
   Word Cloud - Host Presenter
   ===================================================== */
.wc-host-active {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 1rem 2rem;
}

.wc-question {
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    max-width: 80%;
}

.wc-timer {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--t-warning);
}

.wc-cloud {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    min-height: 300px;
    position: relative;
}

.wc-cloud canvas {
    width: 100% !important;
    height: 100% !important;
}

.wc-stats {
    font-size: 1rem;
    color: var(--t-muted);
    text-align: center;
    margin-top: auto;
    padding-bottom: 1rem;
}

/* =====================================================
   Word Cloud - Player Input (play.php)
   ===================================================== */
.wc-word-inputs {
    max-height: 50vh;
    overflow-y: auto;
}

.wc-word-input {
    font-size: 1.1rem;
}

/* Print Styles */
@media print {
    .navbar,
    footer,
    .btn,
    .alert,
    .admin-tabs {
        display: none !important;
    }

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* =====================================================
   Avatar
   ===================================================== */

.avatar-crop-container {
    max-width: 100%;
    max-height: 300px;
    overflow: hidden;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color);
}

.avatar-crop-container img {
    display: block;
    max-width: 100%;
}

.user-avatar-display {
    flex-shrink: 0;
}

/* Random name button on join screen */
.btn-random-name {
    border-style: dashed;
}

/* =====================================================
   Cookie Consent Banner
   ===================================================== */

#cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1060;
    pointer-events: none;
}

.cookie-consent-inner {
    max-width: 720px;
    margin: 0 auto 1rem;
    padding: 0.75rem 1.25rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

/* =====================================================
   Survey
   ===================================================== */

/* --- Builder (activity_edit.php) --- */
.survey-question-card .survey-type-select {
    width: auto;
    min-width: 10rem;
}

.survey-option-marker {
    min-width: 2.75rem;
    justify-content: center;
    color: var(--bs-secondary-color);
}

.survey-qr {
    padding: 0.5rem;
    background: #ffffff;
    border-radius: var(--bs-border-radius);
    line-height: 0;
}

/* --- Respondent (play.php) --- */
.survey-app {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

.survey-message {
    padding: 2rem 0;
}

.survey-hero-icon {
    font-size: 3rem;
    color: var(--t-primary, var(--bs-primary));
}

.survey-identity {
    max-width: 320px;
    margin-bottom: 1.5rem;
    text-align: start;
}

.survey-privacy-note {
    max-width: 420px;
    margin: 0 auto 1.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    background: var(--bs-secondary-bg);
    border-radius: var(--bs-border-radius);
}

.survey-progress-wrap {
    margin-bottom: 1.5rem;
}

.survey-progress {
    height: 6px;
}

.survey-question-body {
    min-height: 12rem;
    margin-bottom: 1rem;
}

.survey-q-text {
    margin-bottom: 0.5rem;
}

.survey-q-help {
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.survey-q-header {
    margin-bottom: 1.5rem;
}

/* Whole-row targets: on a phone the label text is a much easier tap than the
   control itself, so the label is the button. */
.survey-choice {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.875rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    cursor: pointer;
}

.survey-choice:hover {
    border-color: var(--bs-primary);
}

.survey-choice:has(input:checked) {
    border-color: var(--bs-primary);
    background: var(--bs-secondary-bg);
}

.survey-rating-scale {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.survey-rating-option {
    flex: 1 1 3rem;
    min-width: 3rem;
    padding: 0.875rem 0.5rem;
    text-align: center;
    font-weight: 600;
    background: var(--card-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius-lg);
    cursor: pointer;
}

.survey-rating-option:hover {
    border-color: var(--bs-primary);
}

.survey-rating-option.is-selected {
    color: #ffffff;
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.survey-rating-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    color: var(--bs-secondary-color);
}

.survey-nav .btn {
    padding-block: 0.75rem;
}

/* --- Results (survey_results.php) --- */
.survey-bar-row {
    margin-bottom: 0.875rem;
}

.survey-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.survey-bar-track {
    height: 10px;
    background: var(--bs-tertiary-bg);
    border-radius: 999px;
    overflow: hidden;
}

.survey-bar-fill {
    height: 100%;
    background: var(--bs-primary);
    border-radius: 999px;
}

.survey-average {
    font-size: 1.125rem;
}

.survey-cloud-wrap {
    width: 100%;
}

.survey-cloud {
    display: block;
    width: 100%;
    height: auto;
}

/* The list can run to hundreds of answers, so it scrolls rather than pushing
   every following question off the page. */
.survey-responses {
    max-height: 24rem;
    overflow-y: auto;
}

.survey-response {
    padding: 0.75rem 0;
    border-top: 1px solid var(--bs-border-color);
}

.survey-response:first-child {
    border-top: none;
}

.survey-response-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.survey-response-emoji {
    font-size: 1.125rem;
}
