/* ═══════════════════════════════
   SCREEN LAYOUT (auth, dashboard, edit)
═══════════════════════════════ */

.screen-body {
    background: #1a1a2e;
    overflow: auto;
}

.screen-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

/* ── Auth ── */

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

.auth-card {
    background: #232340;
    border-radius: 14px;
    padding: 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.auth-title {
    font-family: 'Alfa Slab One', serif;
    font-size: 28px;
    color: #fff;
    margin-bottom: 24px;
    text-align: center;
}

.auth-switch {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    color: #8da8c4;
    text-align: center;
    margin-top: 20px;
}

.auth-switch a {
    color: #8da8c4;
    text-decoration: underline;
}

/* ── Forms ── */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 160px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
}

.form-label {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #8da8c4;
}

.form-hint {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #5a7a9a;
    text-transform: none;
    letter-spacing: 0;
}

.help-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #5a7a9a;
    color: #1a2432;
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    cursor: help;
}

.help-icon .tooltip {
    display: none;
    position: absolute;
    bottom: 22px;
    left: 0;
    z-index: 20;
    width: 320px;
    padding: 10px 12px;
    background: #1a2432;
    border: 1px solid #5a7a9a;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #e8edf2;
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
    cursor: default;
}

.help-icon .tooltip code {
    color: #8da8c4;
}

.help-icon:hover .tooltip,
.help-icon:focus .tooltip {
    display: block;
}

.form-input {
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    color: #e8edf2;
    background: #16162a;
    border: 1.5px solid #2e3a4e;
    border-radius: 8px;
    padding: 10px 12px;
    width: 100%;
    transition: border-color 0.15s;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #8da8c4;
}

.form-input option {
    background: #16162a;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
    width: 100%;
}

/* ── Buttons ── */

.btn-primary {
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: #2c5f8a;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s;
}

.btn-primary:hover { background: #3a76a8; }

.btn-ghost {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #8da8c4;
    background: transparent;
    border: 1.5px solid #2e3a4e;
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover { border-color: #8da8c4; color: #cdd6e0; }

.btn-danger {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    background: #8a2c2c;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s;
}

.btn-danger:hover { background: #a83a3a; }

/* ── Flash messages ── */

.flash {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.flash-error   { background: #4a1a1a; color: #ffaaaa; }
.flash-success { background: #1a3a1a; color: #aaffaa; }
.flash-warning { background: #3a2e1a; color: #ffd58a; }
.flash-info    { background: #1a2e3a; color: #8ad4ff; }

/* ── Dashboard ── */

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2e3a4e;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.dash-title {
    font-family: 'Alfa Slab One', serif;
    font-size: 26px;
    color: #fff;
}

.dash-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    color: #8da8c4;
}

.dash-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.dash-section-title {
    font-family: 'Alfa Slab One', serif;
    font-size: 20px;
    color: #cdd6e0;
}

.dash-empty {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    color: #5a7a9a;
    text-align: center;
    padding: 40px 0;
}

/* ── Game grid (dashboard) ── */

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.game-card {
    background: #232340;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.game-card-body {
    padding: 18px 18px 12px;
    flex: 1;
}

.game-card-title {
    font-family: 'Alfa Slab One', serif;
    font-size: 18px;
    color: #fff;
    margin-bottom: 8px;
}

.game-card-meta {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    color: #5a7a9a;
}

.game-card-actions {
    padding: 10px 14px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #2e3a4e;
}

.vis-badge {
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-block;
}

.vis-link    { background: #1a3a4a; color: #8ad4ff; }
.vis-private { background: #2e1a3a; color: #c4a0e0; }
.vis-public  { background: #1a3a1a; color: #8affaa; }

.vis-link-copy {
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
}
.vis-link-copy:active { opacity: 0.7; }

/* ── Copy-link toast ── */
.copy-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: rgba(20, 40, 60, 0.95);
    color: #8ad4ff;
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 12px 28px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    border: 1.5px solid #2e5a7a;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 200;
    white-space: nowrap;
}
.copy-toast.open {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Edit screens ── */

.edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2e3a4e;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.edit-title {
    font-family: 'Alfa Slab One', serif;
    font-size: 22px;
    color: #fff;
    flex: 1;
    text-align: center;
}

.edit-section {
    background: #232340;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.edit-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.edit-section-title {
    font-family: 'Alfa Slab One', serif;
    font-size: 16px;
    color: #8da8c4;
    margin-bottom: 14px;
}

.edit-section-header .edit-section-title {
    margin-bottom: 0;
}

.edit-danger {
    border: 1.5px solid #4a2020;
}

/* ── Card list (game_edit) ── */

.card-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #16162a;
    border-radius: 8px;
    flex-wrap: wrap;
}

.card-row-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.card-row-full {
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #e8edf2;
}

.card-row-facts {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    color: #5a7a9a;
}

.card-row-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-has-photo {
    font-size: 13px;
    opacity: 0.7;
    margin-left: 5px;
    vertical-align: middle;
}

.card-has-suggestion {
    font-size: 12px;
    margin-left: 5px;
    vertical-align: middle;
}

.suggestion-list {
    margin-bottom: 14px;
}

.suggestion-row {
    background: rgba(255, 220, 150, 0.12);
    border: 1px solid rgba(255, 220, 150, 0.3);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    color: #e8edf2;
}

.suggestion-row s { color: #8da8c4; }
.suggestion-row strong { color: #fff; }

.suggestion-meta {
    font-size: 12px;
    color: #8da8c4;
    margin: 4px 0 8px;
}

.btn-icon-sm {
    padding: 6px 9px;
    font-size: 15px;
    line-height: 1;
    border-radius: 6px;
}

/* ── Share URL ── */

.share-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.share-url {
    flex: 1;
    font-size: 13px;
    color: #8da8c4;
    cursor: text;
}

/* ── Import panel ── */

.import-panel {
    background: #16162a;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

/* ── Card picker (card_edit relationships) ── */

.card-picker {
    margin-top: 10px;
}

.card-picker-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.card-picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    color: #cdd6e0;
}

.card-id-chip {
    font-family: monospace;
    font-size: 12px;
    background: #16162a;
    padding: 3px 8px;
    border-radius: 5px;
    cursor: pointer;
    color: #8da8c4;
    border: 1px solid #2e3a4e;
    transition: background 0.1s;
}

.card-id-chip:hover { background: #2e3a4e; }

/* ── Media (card_edit) ── */

.card-media-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 12px;
    display: block;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.media-item {
    position: relative;
}

.media-item .card-media-preview {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 0;
}

.media-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.media-delete-btn:hover { background: rgba(180, 40, 40, 0.85); }

.upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.upload-status {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    color: #8da8c4;
}

/* ── Photo clue overlay ── */
/* NOTE: used by the game screen (game.html); kept here to preserve the
   original cascade order when style.css was split. */

.photo-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.photo-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.photo-overlay-img {
    max-width: min(90vw, 640px);
    max-height: 75vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}

.photo-overlay-close {
    font-family: 'Oswald', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 10px 28px;
    cursor: pointer;
}

.clue-photo-item {
    cursor: pointer;
}

.clue-photo-label {
    font-style: italic;
    color: #2c5f8a;
    text-decoration: underline dotted;
}


/* "Read the story" link on a clue */
.clue-story-btn {
    font-family: 'Oswald', sans-serif;
    font-size: 0.85em;
    font-weight: 400;
    color: #5a7a5a;
    background: none;
    border: none;
    padding: 0;
    margin-left: 6px;
    cursor: pointer;
    text-decoration: underline dotted;
    vertical-align: baseline;
}
.clue-story-btn:hover {
    color: #3a5a3a;
}

