:root {
    --bg: #f5f6f8;
    --card: #ffffff;
    --ink: #1f2430;
    --muted: #7a8194;
    --accent: #3b6ef5;
    --line: #e3e6ee;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
}
nav {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 14px 20px;
    display: flex;
    gap: 20px;
}
nav a { color: var(--accent); text-decoration: none; font-weight: 600; }
nav .nav-right { margin-left: auto; }
.linklike { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 1rem; padding: 0; }

.auth-form { display: flex; flex-direction: column; gap: 14px; max-width: 360px; margin-top: 18px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.auth-form input {
    padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
    font-size: 1rem; background: var(--card);
}
.error { color: #d2495b; font-weight: 600; }
.steps { line-height: 1.7; }
.code-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #11151f; color: #e8edf6; padding: 16px 18px; border-radius: 10px;
    font-size: 1.2rem; letter-spacing: .02em; user-select: all; margin: 10px 0;
}
main { max-width: 680px; margin: 0 auto; padding: 24px 18px 60px; }
h1 { font-size: 1.6rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 20px 0;
}
.stat {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.stat .num { font-size: 2rem; font-weight: 700; }
.stat span:last-child { color: var(--muted); font-size: .9rem; }

.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
    background: #5a6b8c;
    text-decoration: none;
    text-align: center;
}
.btn.primary { background: var(--accent); }
.btn.big { display: block; width: 100%; padding: 16px; font-size: 1.1rem; margin-top: 10px; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn.danger { background: #d2495b; }
.hidden { display: none; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 18px;
}
.card .word { font-size: 2.4rem; font-weight: 700; }
.card .pos { color: var(--muted); font-style: italic; margin-top: 4px; }

.answer { text-align: left; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.senses { padding-left: 22px; margin: 0; }
.senses li { margin-bottom: 16px; line-height: 1.5; }
.senses li.current { background: #eef3ff; border-radius: 8px; padding: 8px 10px; }
.pos-inline {
    display: inline-block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 1px 6px;
    margin-right: 6px;
}
.def { }
.example { color: var(--muted); font-style: italic; margin-top: 4px; }
.senses.standalone { padding-top: 10px; }

/* Grouped acceptions */
.acceptions { padding-left: 22px; margin: 0; }
.acceptions > li.acception { margin-bottom: 20px; line-height: 1.5; }
.acception .summary { font-weight: 600; margin-bottom: 6px; }
.acception .forms { list-style: none; padding-left: 0; margin: 0; }
.acception .forms > li {
    padding: 6px 0 6px 12px;
    border-left: 2px solid var(--line);
    margin-bottom: 6px;
}

.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.grades .again { background: #d2495b; }
.grades .hard  { background: #e08a2b; }
.grades .good  { background: #2f9e57; }
.grades .easy  { background: #3b6ef5; }

table.words { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; }
table.words th, table.words td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .92rem; }
table.words th { color: var(--muted); font-weight: 600; }
table.words form { margin: 0; }
