:root {
    --bg: #0b0c10;
    --card: #151821;
    --ink: #e6e7ea;
    --muted: #9aa1ac;
    --accent: #6aa6ff;
}
* {
    box-sizing: border-box;
}
html,
body {
    height: 100%;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
        Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo,
        "Noto Sans JP", sans-serif;
}
.wrap {
    max-width: 1200px;
    margin: 2px auto;
    padding: 0 16px;
}
.title {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 0.2px;
}
.grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 2px;
    margin-top: 2px;
}
.card {
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    padding: 14px;
    margin: 2px;
}
textarea {
    width: 100%;
    min-height: 150px;
    resize: vertical;
    border-radius: 10px;
    background: #0f1220;
    color: var(--ink);
    border: 1px solid #21273a;
    padding: 10px;
}
.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
label {
    font-size: 12px;
    color: var(--muted);
}
input[type="number"],
input[type="range"],
select {
    background: #0f1220;
    color: var(--ink);
    border: 1px solid #21273a;
    border-radius: 8px;
    padding: 6px;
}
input[type="number"] {
    width: 90px;
}
button {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    background: var(--accent);
    color: #08111f;
    box-shadow: 0 6px 18px rgba(106, 166, 255, 0.35);
}
button.secondary {
    background: #444;
    color: #ddd;
}
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.muted {
    color: var(--muted);
}
.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}
th,
td {
    border-bottom: 1px solid #263048;
    padding: 8px;
    text-align: left;
}
.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #0f1220;
    border: 1px solid #21273a;
}
.small {
    font-size: 12px;
}

/* Keyboard */
.kb {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}
.kb-row {
    display: flex;
    gap: 8px;
}
.key {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: 2px solid #2a3149;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.05s, border-color 0.2s, background 0.2s;
}
.key:hover {
    transform: translateY(-2px);
}
.key .label {
    font-weight: 800;
    opacity: 0.95;
    letter-spacing: 0.3px;
}
.key .count {
    font: 11px/1 ui-monospace, monospace;
    color: #d6d8df;
    opacity: 0.9;
}
.key.space {
    width: 360px;
}

.legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.chip {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #263048;
    border-radius: 999px;
    padding: 4px 8px;
}
.swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid #0006;
}

.grad {
    height: 10px;
    width: 80%;
    background: linear-gradient(
        90deg,
        hsl(220 80% 25%),
        hsl(160 80% 35%),
        hsl(60 90% 50%),
        hsl(20 90% 55%),
        hsl(0 95% 58%)
    );
    border-radius: 999px;
}

.rank-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.social-links {
    display: flex;
    height: 100%;
    align-items: flex-end;
    justify-content: space-between;
}
.social-links .logo-area {
    display: flex;
    gap: 16px;
}
.social-links .logo {
    width: 32px;
    height: 32px;
    transition: transform 0.2s ease;
}

.social-links .logo:hover {
    transform: scale(1.2);
}

.btn-amazon {
    display: inline-block;
    padding: 0.3em 0.3em;
    border-radius: 8px;
    background: #febd69;
    color: #111;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}
.btn-amazon:hover {
    transform: scale(1.2);
}

@media (max-width: 1000px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .key.space {
        width: 220px;
    }
    .kb-row {
        width: 100%;
        display: flex;
        gap: 2px;
        justify-content: center;
    }
    .key {
        width: calc(100% / 12);
        height: 24px;
        border-width: 1px;
        border-radius: 6px;
    }
    .key .count {
        display: none;
    }
    .rank-grid {
        grid-template-columns: 1fr;
    }
}
