/* ======================================================
   DESIGN D: 鮮やかな青 × 空色
   王道塾系。明るく信頼感のあるブルー
   ====================================================== */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --sky: #dbeafe;
    --sky-soft: #eff6ff;
    --accent: #0ea5e9;

    --ink: #1f2937;
    --text: #374151;
    --text-mute: #6b7280;
    --text-faint: #9ca3af;

    --border: #e5e7eb;
    --border-soft: #f3f4f6;
    --bg: #ffffff;
    --bg-subtle: #f9fafb;

    --success: #16a34a;
    --warning: #ca8a04;
    --danger: #dc2626;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(37, 99, 235, 0.12);

    --font-jp: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
    --font-display: "Inter", "Noto Sans JP", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-jp);
    font-size: 15px;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    color: var(--ink);
    font-weight: 700;
    margin: 0 0 0.6em;
    line-height: 1.4;
    letter-spacing: -0.01em;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Layout ---------- */
.page-wrap { max-width: 1040px; margin: 0 auto; padding: 28px 20px 60px; }

/* ---------- Header ---------- */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}
.site-header__inner {
    max-width: 1040px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-wrap: wrap;
}
.site-header__brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
}
.site-header__brand:hover { color: var(--ink); text-decoration: none; }
.site-header__logo {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
}
.site-header__nav {
    display: flex; align-items: center; gap: 18px;
    font-size: 0.92rem;
}
.site-header__nav a { color: var(--text); }
.site-header__nav a:hover { color: var(--primary); text-decoration: none; }
.site-header__user {
    font-size: 0.86rem;
    color: var(--text-mute);
    padding: 4px 12px;
    background: var(--sky-soft);
    border-radius: 999px;
}

/* ---------- Footer ---------- */
.site-footer {
    max-width: 1040px; margin: 60px auto 0;
    padding: 24px 20px 40px;
    font-size: 0.85rem; color: var(--text-faint);
    text-align: center;
    border-top: 1px solid var(--border);
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(135deg, var(--sky-soft) 0%, #ffffff 60%, var(--sky-soft) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 32px 52px;
    margin-bottom: 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: "";
    position: absolute;
    width: 200px; height: 200px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.5;
}
.hero::before {
    top: -60px; left: -60px;
    background: radial-gradient(circle, var(--primary-light), transparent 70%);
    opacity: 0.18;
}
.hero::after {
    bottom: -80px; right: -60px;
    background: radial-gradient(circle, var(--accent), transparent 70%);
    opacity: 0.14;
}
.hero__inner { position: relative; z-index: 1; }
.hero__kicker {
    display: inline-block;
    padding: 5px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    margin-bottom: 18px;
}
.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 16px;
    line-height: 1.4;
}
.hero h1 .accent {
    background: linear-gradient(120deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    color: var(--text);
    max-width: 560px;
    margin: 0 auto 28px;
    font-size: 1rem;
}
.hero__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    text-decoration: none;
    background: var(--primary);
    color: #fff;
    line-height: 1.2;
}
.btn:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn--ghost {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--primary);
}
.btn--ghost:hover {
    background: var(--sky-soft);
    color: var(--primary-dark);
    border-color: var(--primary-dark);
}
.btn--neutral {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}
.btn--neutral:hover {
    background: var(--bg-subtle);
    color: var(--ink);
    border-color: var(--text-mute);
}
.btn--block { display: block; width: 100%; }
.btn--sm { padding: 7px 14px; font-size: 0.85rem; }

/* ---------- Card ---------- */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    margin-bottom: 20px;
}
.card__title {
    margin-top: 0;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 10px;
}
.card__title .num-mark {
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

/* ---------- Section header ---------- */
.section-title {
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary);
    margin: 28px 0 14px;
    font-weight: 700;
}

/* ---------- Feature list (top page) ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}
@media (max-width: 720px) {
    .features { grid-template-columns: 1fr; }
}
.feature {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 22px;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.feature:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.feature__icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--sky-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 14px;
    font-size: 1.2rem;
}
.feature h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}
.feature p {
    color: var(--text-mute);
    font-size: 0.9rem;
    line-height: 1.7;
    margin: 0;
}

/* ---------- Dashboard ---------- */
.user-summary {
    background: linear-gradient(135deg, var(--sky-soft) 0%, var(--bg) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.user-summary__avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.user-summary__info { flex: 1; min-width: 0; }
.user-summary__name {
    font-weight: 700;
    color: var(--ink);
    font-size: 1.05rem;
}
.user-summary__meta {
    color: var(--text-mute);
    font-size: 0.86rem;
}
.tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 20px;
}
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }
.tile {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    color: var(--text);
    text-decoration: none;
    position: relative;
    min-height: 170px;
    transition: all 0.18s;
    overflow: hidden;
}
.tile::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.18s;
}
.tile:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    color: var(--text);
    text-decoration: none;
}
.tile:hover::before { opacity: 1; }
.tile__icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--sky-soft);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 14px;
    font-size: 1.15rem;
    font-weight: 700;
}
.tile__label {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--ink);
}
.tile__desc {
    font-size: 0.86rem;
    color: var(--text-mute);
    line-height: 1.65;
}
.tile__status {
    position: absolute;
    top: 18px; right: 18px;
    font-size: 0.72rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--sky-soft);
    color: var(--primary);
    font-weight: 600;
}
.tile__status--closed {
    background: var(--bg-subtle);
    color: var(--text-faint);
}
.tile--disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.4);
}
.tile--disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
}

/* ---------- Ranking summary ---------- */
.ranking-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
@media (max-width: 520px) {
    .ranking-summary { grid-template-columns: 1fr; }
}
.ranking-stat {
    background: var(--sky-soft);
    border: 1px solid var(--sky);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    text-align: center;
}
.ranking-stat--highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-color: var(--primary);
    color: #fff;
}
.ranking-stat__label {
    font-size: 0.78rem;
    color: var(--text-mute);
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.ranking-stat--highlight .ranking-stat__label {
    color: rgba(255, 255, 255, 0.85);
}
.ranking-stat__value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.ranking-stat--highlight .ranking-stat__value { color: #fff; }
.ranking-stat__value .unit {
    font-size: 0.7rem;
    margin-left: 3px;
    font-weight: 500;
    color: var(--text-mute);
}
.ranking-stat--highlight .ranking-stat__value .unit { color: rgba(255, 255, 255, 0.8); }

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
    overflow-x: auto;
}
.tabs a {
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-mute);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}
.tabs a.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.tabs a:hover { color: var(--ink); text-decoration: none; }

/* ---------- Score table ---------- */
.score-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 0.92rem;
}
.score-table th, .score-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
}
.score-table thead th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--text);
    font-size: 0.84rem;
    border-bottom: 1px solid var(--border);
}
.score-table tfoot th {
    border-top: 2px solid var(--primary);
    background: var(--sky-soft);
    color: var(--ink);
}
.score-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--ink);
}

/* ---------- Note ---------- */
.note {
    font-size: 0.84rem;
    color: var(--text-mute);
    padding: 12px 14px;
    background: var(--sky-soft);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    margin: 14px 0;
}

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-mute { color: var(--text-mute); }
.text-small { font-size: 0.85rem; }
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.mt-3 { margin-top: 24px; }
.actions-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ---------- Form ---------- */
.form { padding: 28px 26px; }
.form-section-title {
    font-size: 1rem;
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--ink);
}
.form-section-title:first-of-type { margin-top: 8px; }
.form-section-hint {
    font-size: 0.8rem;
    color: var(--text-mute);
    font-weight: 500;
    margin-left: 6px;
}
.form-row { margin-bottom: 14px; }
.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 6px;
}
.form-required {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background: var(--danger);
    border-radius: 999px;
    vertical-align: 1px;
}
.form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
select.form-control {
    background-image: linear-gradient(45deg, transparent 50%, var(--text-mute) 50%), linear-gradient(135deg, var(--text-mute) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-control.has-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.form-control--num { font-variant-numeric: tabular-nums; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.form-grid--small { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 720px) {
    .form-grid,
    .form-grid--small { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 420px) {
    .form-grid,
    .form-grid--small { grid-template-columns: repeat(2, 1fr); }
}
.form-error {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: var(--danger);
}
.form-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--danger);
    color: #7f1d1d;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}
.form-alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
}
.form-alert li { margin: 2px 0; }
.form-success {
    background: var(--sky-soft);
    border: 1px solid var(--sky);
    border-left: 4px solid var(--primary);
    color: var(--primary-dark);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}
