body {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

.navbar {
    background-color: #16213e !important;
}

.card {
    background-color: #1f2937;
    border-color: #374151;
}

.card-header {
    background-color: #111827;
    border-color: #374151;
}

/* Sequence display */
.sequence-container {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    overflow-x: auto;
    padding: 16px 0;
}

.sequence-container.vertical {
    flex-direction: column;
    align-items: center;
}

.grid-slot {
    flex-shrink: 0;
    text-align: center;
    min-width: 100px;
}

.grid-slot .slot-label {
    font-size: 0.85em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.grid-slot .grid-wrapper {
    display: inline-block;
    border: 2px solid #374151;
    border-radius: 4px;
    overflow: hidden;
}

.grid-slot.masked .grid-wrapper {
    border-color: #f59e0b;
    border-style: dashed;
}

.masked-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #374151;
    color: #f59e0b;
    font-size: 2rem;
    font-weight: bold;
}

/* Arrow between grids */
.sequence-arrow {
    display: flex;
    align-items: center;
    color: #6b7280;
    font-size: 1.5rem;
    flex-shrink: 0;
    padding-top: 20px;
}

/* Grid editor */
.grid-editor {
    display: inline-block;
}

.grid-editor .cell {
    cursor: pointer;
}

.grid-editor .cell:hover {
    opacity: 0.8;
}

/* Narrative reveal */
.narrative-container {
    margin: 20px 0;
}

.narrative-reveal-btn {
    cursor: pointer;
    padding: 12px 20px;
    background: #1f2937;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    color: #f59e0b;
    font-size: 1rem;
    transition: all 0.2s;
}

.narrative-reveal-btn:hover {
    background: #374151;
}

.narrative-text {
    display: none;
    padding: 16px 20px;
    background: #2d1f00;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #fbbf24;
    font-style: italic;
    font-size: 1.1em;
    line-height: 1.6;
    margin-top: 8px;
}

.narrative-text.visible {
    display: block;
}

/* Feedback */
.feedback-grid .cell.correct {
    box-shadow: inset 0 0 0 2px #2ECC40;
}

.feedback-grid .cell.wrong {
    box-shadow: inset 0 0 0 2px #FF4136;
}

/* Dimension inputs */
.dim-input {
    width: 70px;
    background: #374151;
    border: 1px solid #4b5563;
    color: #e0e0e0;
    border-radius: 4px;
    padding: 2px 6px;
    text-align: center;
    font-size: 0.85em;
}

/* Puzzle cards for browse */
.puzzle-card {
    cursor: pointer;
    transition: transform 0.1s;
}

.puzzle-card:hover {
    transform: translateY(-2px);
}

/* Vote widget */
.vote-widget {
    min-width: 30px;
    cursor: default;
}
.vote-widget button {
    line-height: 1;
    text-decoration: none;
    opacity: 0.4;
    color: #9ca3af;
}
.vote-widget button:hover {
    opacity: 1;
}
.vote-widget button.text-warning,
.vote-widget button.text-primary {
    opacity: 1;
}

/* Phase indicator */
.phase-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.phase-badge.phase1 {
    background: #374151;
    color: #9ca3af;
}

.phase-badge.phase2 {
    background: #2d1f00;
    color: #f59e0b;
}

/* Skip button */
.skip-btn {
    color: #9ca3af;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9em;
}

.skip-btn:hover {
    color: #e0e0e0;
}

/* Tag filter buttons */
.tag-btn.active {
    color: #fff !important;
    font-weight: 600;
}

.tag-btn.active.btn-outline-info { background-color: #0dcaf0; border-color: #0dcaf0; }
.tag-btn.active.btn-outline-warning { background-color: #ffc107; border-color: #ffc107; color: #000 !important; }
.tag-btn.active.btn-outline-success { background-color: #198754; border-color: #198754; }
.tag-btn.active.btn-outline-secondary { background-color: #6c757d; border-color: #6c757d; }
.tag-btn.active.btn-outline-light { background-color: #f8f9fa; border-color: #f8f9fa; color: #000 !important; }
.tag-btn.active.btn-outline-danger { background-color: #dc3545; border-color: #dc3545; }

.btn-narc {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: #000;
}

.btn-narc:hover {
    background-color: #d97706;
    border-color: #d97706;
    color: #000;
}

/* Admin dashboard */
.admin-submission-card {
    border-left: 4px solid #6c757d;
}

.admin-submission-card.submission-new_puzzle {
    border-left-color: #f59e0b;
}

.admin-submission-card.submission-revision {
    border-left-color: #8b5cf6;
}

.admin-submission-card.submission-variant {
    border-left-color: #0dcaf0;
}
