#name-setup[hidden],
#mood-main[hidden],
#view-today[hidden],
#view-history[hidden] { display: none; }

main.mood-main {
    padding: 2rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#mood-app {
    width: 100%;
    max-width: 480px;
}

/* ── Name setup ─────────────────────────────────────────────────────────── */

#name-setup {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    padding: 5rem 0;
}

#name-setup p {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

#name-input {
    width: 200px;
    text-align: center;
    font-size: 1.05rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-family: inherit;
    color: var(--fg);
    outline: none;
    box-sizing: border-box;
}

#name-input:focus {
    border-color: var(--fg);
}

#name-submit {
    background: var(--fg);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.6rem;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}

#name-submit:hover { opacity: 0.7; }

/* ── Submit area ────────────────────────────────────────────────────────── */

#submit-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

#swatch-label {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 0 0 1.5px var(--border);
    transition: box-shadow 0.15s;
}

#swatch-label:hover {
    box-shadow: 0 0 0 2px var(--fg);
}

#color-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

#word-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--fg);
    outline: none;
}

#word-input:focus {
    border-color: var(--fg);
}

#submit-btn {
    background: var(--fg);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

#submit-btn:hover { opacity: 0.7; }

/* ── Today header ───────────────────────────────────────────────────────── */

#today-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#today-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

#history-btn, #back-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#history-btn:hover, #back-btn:hover { color: var(--fg); }

/* ── Today grid ─────────────────────────────────────────────────────────── */

#today-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

#today-empty {
    font-size: 0.9rem;
    color: var(--muted);
}

.mood-card {
    width: 140px;
    height: 100px;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.mood-card.mine {
    box-shadow: 0 0 0 2.5px var(--fg);
}

.card-word {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.card-name {
    font-size: 0.75rem;
    opacity: 0.75;
}

/* ── History view ───────────────────────────────────────────────────────── */

#history-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

#history-header span {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

#history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 0.6rem;
}

.history-tile {
    border-radius: 8px;
    padding: 0.6rem 0.65rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1;
    box-sizing: border-box;
}

.tile-word {
    font-size: 0.82rem;
    font-weight: 600;
    word-break: break-word;
    line-height: 1.2;
}

.tile-date {
    font-size: 0.7rem;
    opacity: 0.72;
}

#history-empty {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 1rem;
}
