/* =========================================
   Cipher Decoder Game Styles
   ========================================= */

.cipher-hint {
    font-size: 0.85rem;
    color: var(--depths);
    line-height: 1.5;
    opacity: 0.85;
    padding: 0 8px;
}

/* ---- Section Label ---- */
.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--horizon);
    margin-bottom: 8px;
}

/* ---- Cipher Display ---- */
#cipher-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    justify-content: center;
    background: var(--white);
    border: 2px solid var(--drift);
    border-radius: 14px;
    padding: 14px 10px 10px;
    margin-bottom: 14px;
    font-family: 'Courier New', Courier, monospace;
}

.word-group {
    display: flex;
    gap: 1px;
}

/* Letter pair: cipher on top, decoded on bottom */
.char-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 14px;
}

.char-top {
    font-size: 10px;
    font-weight: 700;
    color: var(--horizon);
    line-height: 1.3;
    text-transform: uppercase;
    user-select: none;
}

.char-bot {
    font-size: 13px;
    font-weight: 800;
    color: var(--mist);
    line-height: 1.3;
    text-align: center;
    border-bottom: 2px solid var(--drift);
    min-width: 12px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.char-bot.revealed {
    color: var(--navy);
    border-bottom-color: var(--navy);
    animation: pop-reveal 0.35s ease;
}

@keyframes pop-reveal {
    0%   { transform: scale(1);    color: var(--gold-bright); }
    50%  { transform: scale(1.35); color: var(--gold-bright); }
    100% { transform: scale(1);    color: var(--navy); }
}

/* Punctuation cells (comma, !, etc.) */
.punc-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 8px;
}

.char-top.punc,
.char-bot.punc {
    font-size: 11px;
    color: var(--depths);
    border-bottom: none;
    font-weight: 400;
}

/* ---- Progress Bar ---- */
.progress-wrap {
    margin-bottom: 16px;
}

.progress-bar-track {
    background: var(--breeze);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 4px;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--horizon), var(--depths));
    border-radius: 99px;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--horizon);
}

/* ---- Guess Area ---- */
#guess-area {
    margin-bottom: 14px;
}

.guess-info {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

#guesses-left {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--horizon);
    transition: color 0.3s ease;
}

#guesses-left.low {
    color: #d9534f;
}

.input-row {
    display: flex;
    gap: 8px;
}

#guess-input {
    flex: 1;
    padding: 12px 14px;
    font-size: 0.95rem;
    border: 2px solid var(--drift);
    border-radius: 12px;
    color: var(--navy);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
}

#guess-input:focus {
    border-color: var(--horizon);
}

#guess-input:disabled {
    background: var(--breeze);
    color: var(--mist);
}

#submit-btn {
    padding: 12px 18px;
    background: var(--horizon);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
}

#submit-btn:active {
    background: var(--depths);
}

#submit-btn:disabled {
    background: var(--mist);
    cursor: not-allowed;
}

/* ---- Guess History ---- */
#history-area {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    background: var(--white);
    border: 1.5px solid var(--breeze);
    border-radius: 10px;
    font-size: 0.82rem;
}

.history-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--breeze);
    color: var(--horizon);
    font-size: 0.72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.history-text {
    flex: 1;
    color: var(--depths);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
}

.history-result {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mist);
    flex-shrink: 0;
}

.history-result.hit {
    color: var(--success);
}

/* ---- Toast ---- */
#toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--navy);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 1;
    transition: opacity 0.4s ease;
    white-space: nowrap;
    max-width: 320px;
    white-space: normal;
    text-align: center;
}

.toast.fade-out {
    opacity: 0;
}
