body {
    max-width: 720px;
    margin: 0 auto;
    padding: 1rem 1rem 3rem;
}

h1 {
    margin: 1rem 0 1.5rem;
}

#meta {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

#snippet {
    text-align: left;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1rem;
    line-height: 1.4;
    padding: 1rem 1.25rem;
    background: rgba(127, 127, 127, 0.15);
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre;
    min-height: 6rem;
}

#guess-form {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    margin: 1.5rem 0 0.5rem;
}

#guess {
    flex: 1;
    min-width: 0;
    font-size: 1.25rem;
    line-height: 1.2;
    height: 2.6rem;
    padding: 0 0.8rem;
    box-sizing: border-box;
    border: 1px solid rgba(127, 127, 127, 0.5);
    border-radius: 6px;
    background: transparent;
    color: inherit;
}

#guess:focus {
    outline: none;
    border-color: rgba(100, 150, 255, 0.9);
}

#guess.correct {
    border-color: rgba(76, 175, 80, 0.9);
    background: rgba(76, 175, 80, 0.15);
}

#guess.incorrect {
    border-color: rgba(244, 67, 54, 0.9);
    background: rgba(244, 67, 54, 0.15);
}

#submit,
#next,
#play-again {
    font-size: 1.25rem;
    height: 2.6rem;
    padding: 0 1.25rem;
    box-sizing: border-box;
    cursor: pointer;
}

#submit {
    margin: 0;
}

#submit:disabled {
    cursor: default;
    opacity: 0.6;
}

#result {
    min-height: 1.5rem;
    margin: 0.5rem 0 0;
    font-weight: 600;
}

#result.correct {
    color: rgb(76, 175, 80);
}

#result.incorrect {
    color: rgb(244, 67, 54);
}

#tell {
    min-height: 3rem;
    font-style: italic;
    margin: 0.5rem 0 1rem;
    padding: 0 0.5rem;
}

#next,
#play-again {
    margin: 0.5rem 0 1rem;
}

#final-score {
    font-size: 1.5rem;
    margin: 1.5rem 0;
}

#mode-select {
    margin: 2rem 0;
}

.mode-prompt {
    font-size: 1.15rem;
    margin: 0 0 1rem;
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 1rem 0.75rem;
    border: 1px solid rgba(127, 127, 127, 0.5);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.mode-btn:hover {
    border-color: rgba(100, 150, 255, 0.9);
    background: rgba(100, 150, 255, 0.1);
}

.mode-btn[data-length="8"]:hover   { border-color: rgba(76, 175, 80, 0.9);  background: rgba(76, 175, 80, 0.12); }
.mode-btn[data-length="16"]:hover  { border-color: rgba(100, 150, 255, 0.9); background: rgba(100, 150, 255, 0.12); }
.mode-btn[data-length="32"]:hover  { border-color: rgba(255, 152, 0, 0.9);  background: rgba(255, 152, 0, 0.12); }
.mode-btn[data-length="64"]:hover  { border-color: rgba(244, 67, 54, 0.9);  background: rgba(244, 67, 54, 0.15); }

.mode-count {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.75;
}

#mode-label {
    opacity: 0.7;
}
