:root {
    --bg-color: #fff;
    --bg-soft: #f5f5f5;
    --bg-hover: #ebebeb;
    --card-bg: #fff;
    --brand-color: #5b3f78;
    --brand-hover: #4a3263;
    --brand-active: #39264c;
    --text-link: #0071c1;
    --text-link-hover: #005c9e;
    --text-main: #23221e;
    --text-muted: #555;
    --text-disabled: #696969;
    --line-color: #d9d9d9;
    --border-control: #858585;
    --tri-dark: #1f5349;
    --tri-pale: #e1efec;
    --green-50: oklch(0.9705 0.0165 162.8);
    --green-700: oklch(0.5306 0.1225 154.9);
    --red-50: oklch(0.9669 0.0162 17.4);
    --red-600: oklch(0.5656 0.1869 27.3);
    --red-700: oklch(0.499 0.1804 28.1);
    --gold: #8a641d;
    --silver: oklch(0.4489 0.02 251.1);
    --bronze: #975b38;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--brand-color); outline-offset: 3px; }

html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.7;
    letter-spacing: 0.02em;
}

.header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--line-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.875rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { font-size: 1.35rem; line-height: 1.3; font-weight: 700; }

.logo-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--brand-color);
    text-decoration: none;
}

.logo span { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }

.nav-menu ul { list-style: none; display: flex; gap: 1.5rem; }

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: color 0.15s;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active { color: var(--brand-color); }

.nav-support-item { position: relative; }

.nav-support-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
}

.nav-support-toggle::after {
    content: '';
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-0.12rem) rotate(45deg);
    transition: transform 0.15s;
}

.nav-support-item:is(:hover, :focus-within, .is-open) .nav-support-toggle::after {
    transform: translateY(0.12rem) rotate(225deg);
}

.nav-menu .nav-support-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.875rem);
    right: 0;
    min-width: 13rem;
    padding: 0.4rem 0;
    flex-direction: column;
    gap: 0;
    background: var(--card-bg);
    border: 1px solid var(--line-color);
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 0.5rem 1.25rem rgb(0 0 0 / 0.12);
}

.nav-menu .nav-support-menu::before {
    content: '';
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: 0.875rem;
}

.nav-support-item:is(:hover, :focus-within, .is-open) .nav-support-menu { display: flex; }

.nav-menu .nav-support-menu .nav-link { display: block; padding: 0.6rem 1rem; }

.nav-menu .nav-support-menu .nav-link:hover,
.nav-menu .nav-support-menu .nav-link.active {
    background: var(--bg-soft);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.4rem;
    cursor: pointer;
}

.main-content {
    max-width: 1000px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    min-height: 70vh;
}

.page-title,
h2 {
    font-size: 1.5rem;
    line-height: 1.4;
    border-bottom: 2px solid var(--line-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-main);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

h3 { font-size: 1.15rem; line-height: 1.4; margin-bottom: 0.75rem; }

.content-box > h2 {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    padding-bottom: 0;
    border-bottom: 0;
}

.content-box > h2.result-section-heading { margin-top: 1.5rem; }

p { margin-bottom: 0.75rem; }

.hero-image-container { width: 100%; margin-bottom: 1.5rem; border: 1px solid var(--line-color); }

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.content-box {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border: 1px solid var(--line-color);
    margin-bottom: 1.25rem;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.quick-links button,
.quick-links a.quick-link-btn {
    display: inline-block;
    background-color: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-control);
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.15s;
}

.quick-links button:hover,
.quick-links a.quick-link-btn:hover { background-color: var(--bg-soft); }

.btn-entry {
    display: inline-block;
    background-color: var(--brand-color);
    color: #fff;
    border: none;
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.15s;
}

.btn-entry:hover { background-color: var(--brand-hover); }

.rules-list { padding-left: 1.75rem; margin-top: 0.5rem; margin-bottom: 0.5rem; }

.rules-list li { margin-bottom: 0.75rem; line-height: 1.75; padding-left: 0.25rem; }

.rules-list li:last-child { margin-bottom: 0; }

.news-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.news-list::-webkit-scrollbar { width: 6px; }

.news-list::-webkit-scrollbar-thumb { background-color: var(--line-color); border-radius: 3px; }

.news-item { padding: 0.85rem 1rem; background-color: var(--bg-soft); border-left: 3px solid var(--line-color); }

.news-title { font-weight: 700; margin-bottom: 0.2rem; color: var(--text-main); }

.news-title-link { color: var(--text-link); text-decoration: underline; text-underline-offset: 2px; }

.news-title-link:hover { color: var(--text-link-hover); }

.news-date {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.news-body { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

.results-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card { background-color: var(--card-bg); border: 1px solid var(--line-color); padding: 1.25rem; }

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--line-color);
    padding-bottom: 0.65rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.result-header h2 {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 1.15rem;
    color: var(--text-main);
}

.result-header .date { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }

.result-body { padding: 0; }

.winner-comment {
    background-color: var(--bg-soft);
    border-left: 3px solid var(--line-color);
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    font-style: normal;
    color: var(--text-main);
}

.tournament-tonamel-link { margin-top: 1.5rem; }

.tournament-tonamel-link a {
    font-size: 0.85rem;
    color: var(--text-link);
    font-weight: 700;
    text-decoration: none;
}

.tournament-tonamel-link a:hover { text-decoration: underline; }

.image-placeholder {
    width: 100%;
    height: 180px;
    background-color: var(--bg-soft);
    border: 1px dashed var(--line-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.5rem;
}

.page-btn {
    background-color: var(--card-bg);
    border: 1px solid var(--line-color);
    color: var(--text-main);
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
}

.page-btn:hover:not(:disabled) { background: var(--bg-soft); }

.page-btn.active { background-color: var(--brand-color); border-color: var(--brand-color); color: #fff; }

.ranking-section { margin-bottom: 2rem; }

.table-container { overflow-x: auto; border: 1px solid var(--line-color); }

.ranking-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background-color: var(--card-bg);
}

.ranking-table th, .ranking-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line-color);
    border-right: 1px solid var(--line-color);
}

.ranking-table th:last-child, .ranking-table td:last-child { border-right: none; }

.ranking-table th:nth-child(1), .ranking-table td:nth-child(1) { width: 20%; }

.ranking-table th:nth-child(2), .ranking-table td:nth-child(2) { width: 50%; }

.ranking-table th:nth-child(3), .ranking-table td:nth-child(3) { width: 30%; }

.ranking-table tbody tr:last-child td { border-bottom: none; }

.ranking-table th { background-color: var(--bg-soft); font-size: 0.85rem; }

.rank-1 { color: var(--gold); font-weight: bold; }

.rank-2 { color: var(--silver); font-weight: bold; }

.rank-3 { color: var(--bronze); font-weight: bold; }

.route-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
    padding: 0 1rem;
}

.route-links a,
.route-next a { color: var(--text-link); font-weight: 700; text-underline-offset: 0.2em; }

.route-step { margin-top: 2rem; padding-top: 1.5rem; }

.route-step:first-child { margin-top: 1rem; padding-top: 0; }

.route-step h2 {
    font-size: 1.15rem;
    border: 0;
    padding: 0;
    margin-bottom: 0.75rem;
    scroll-margin-top: 7rem;
}

.route-image {
    display: block;
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 1rem auto;
    border: 1px solid var(--line-color);
}

.route-notice { color: var(--red-700); font-weight: 700; }

.venue-info p { margin-bottom: 0.25rem; }

.map-frame { border: 1px solid var(--line-color); line-height: 0; margin-top: 0.75rem; }

.map-frame iframe { display: block; border: 0; }

.map-facade {
    width: 100%;
    height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--bg-soft);
    border: none;
    cursor: pointer;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    transition: background-color 0.15s;
}

.map-facade:hover { background-color: var(--bg-hover); }

.map-facade-icon { width: 2.2rem; height: 2.2rem; }

.contact-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.25rem 0;
}

.contact-item h4, .tonamel-link h4 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.25rem; }

.social-link, .email-link, .tonamel-link a {
    display: inline-block;
    color: var(--text-link);
    text-decoration: none;
    font-weight: 700;
}

.social-link:hover, .email-link:hover, .tonamel-link a:hover { text-decoration: underline; }

.tonamel-link { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line-color); }

footer {
    text-align: center;
    padding: 1.75rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--line-color);
    margin-top: 2.5rem;
}

footer a { color: var(--text-muted); margin-left: 0.5rem; }

footer a:hover { color: var(--text-link-hover); }

.footer-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    margin-bottom: 0;
}

.quiz-introduction a { color: var(--text-link); font-weight: 700; }

.quiz-section { margin-top: 2.5rem; scroll-margin-top: 6rem; }

.quiz-section > h2 {
    border: 0;
    padding: 0;
    margin-bottom: 0.5rem;
}

.quiz-card {
    background: var(--card-bg);
    border: 1px solid var(--line-color);
    margin-top: 1rem;
    padding: 1.5rem;
}

.quiz-progress { color: var(--text-main); font-weight: 700; font-size: 1.1rem; }

.quiz-progress span { color: var(--text-muted); font-size: 0.9rem; }

.quiz-question { font-size: 1.1rem; font-weight: 700; margin: 1rem 0 1.25rem; }

.quiz-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }

.quiz-choice, .quiz-next, .quiz-restart, .quiz-share, .quiz-start-button {
    min-height: 48px;
    border: 1px solid var(--border-control);
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0.65rem 1rem;
    transition: background-color 0.15s, color 0.15s;
}

.quiz-choice:hover:not(:disabled), .quiz-restart:hover, .quiz-start-button:hover { background: var(--bg-soft); }

.quiz-choice:disabled { cursor: default; }

.quiz-choice.is-correct-choice {
    background: var(--green-50);
    border-color: var(--green-700);
    color: var(--green-700);
}

.quiz-choice.is-selected-incorrect {
    background: var(--red-50);
    border-color: var(--red-600);
    color: var(--red-700);
}

.quiz-question:focus,
.quiz-result:focus,
.quiz-summary-label:focus,
.quiz-count:focus { outline-offset: 6px; }

.quiz-feedback { margin-top: 1.25rem; }

.quiz-result { font-size: 1.35rem; font-weight: 700; margin-bottom: 0.35rem; }

.quiz-result.is-correct { color: var(--green-700); }

.quiz-result.is-incorrect { color: var(--red-700); }

.quiz-answer { margin-bottom: 0.5rem; }

.quiz-explanation { color: var(--text-muted); }

.quiz-next, .quiz-share, .quiz-start-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-color);
    color: #fff;
    text-decoration: none;
    border-color: var(--brand-color);
    margin-top: 0.5rem;
}

.quiz-next:hover, .quiz-share:hover { background: var(--brand-hover); }

.quiz-summary { text-align: center; padding: 1rem 0; }

.quiz-summary-label { color: var(--text-muted); font-weight: 700; }

.quiz-score { font-size: 1.4rem; margin: 0.25rem 0 1.25rem; }

.quiz-score strong { font-size: 2.5rem; color: var(--text-main); }

.quiz-summary-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quiz-summary-actions > * {
    min-width: 11rem;
    height: 50px;
    min-height: 0;
    margin-top: 0;
}

.quiz-start { text-align: center; padding: 1rem 0; }

.quiz-count { color: var(--text-muted); font-weight: 700; margin-bottom: 0.75rem; }

.quiz-start-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quiz-start-actions .quiz-start-button { min-width: 13rem; height: 50px; margin-top: 0; }

.quiz-start-button-secondary { background: var(--card-bg); color: var(--text-main); border-color: var(--border-control); }

.quiz-start-button-secondary:hover { background: var(--bg-soft); }

.article-page .article-header { margin-bottom: 1.25rem; }

.article-page .article-meta {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.article-page .page-title { margin-bottom: 0.5rem; }

.article-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border: 1px solid var(--line-color);
    margin-bottom: 1.25rem;
}

.article-body p { margin-bottom: 1rem; }

.article-back-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--text-link);
    font-weight: 700;
    text-decoration: none;
}

.article-back-link:hover { text-decoration: underline; }

.results-detail-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--text-link);
    font-weight: 700;
    text-decoration: none;
}

.results-detail-link:hover { text-decoration: underline; }

.result-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.result-action-row .results-detail-link,
.result-action-row .article-back-link { margin-top: 0; }

.report-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-link);
    font-weight: 700;
    text-decoration: none;
}

.report-link:hover { text-decoration: underline; }

.results-detail-table { table-layout: auto; }

.results-detail-table th,
.results-detail-table td { width: auto; white-space: nowrap; }

@media (min-width: 769px) and (max-width: 960px) {
    .header-container { gap: 1rem; }

    .logo-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
        white-space: nowrap;
    }

    .nav-menu > ul { gap: 0.75rem; }

    .nav-link { white-space: nowrap; }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--card-bg);
        border-bottom: 1px solid var(--line-color);
    }

    .nav-menu.active { display: block; }

    .nav-menu ul { flex-direction: column; gap: 0; }

    .nav-menu ul li a { display: block; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line-color); }

    .nav-support-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--line-color);
    }

    .nav-support-toggle::after,
    .nav-support-item:is(:hover, :focus-within, .is-open) .nav-support-toggle::after {
        transform: translateY(-0.12rem) rotate(45deg);
    }

    .nav-menu .nav-support-menu,
    .nav-support-item:is(:hover, :focus-within, .is-open) .nav-support-menu {
        display: block;
        position: static;
        min-width: 0;
        padding: 0;
        background: var(--bg-soft);
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .nav-menu .nav-support-menu::before { content: none; }

    .nav-menu .nav-support-menu .nav-link { padding: 0.75rem 1rem 0.75rem 2rem; font-size: 0.86rem; }

    .menu-toggle { display: block; }

    .quiz-card { padding: 1.15rem; }
}

@media (max-width: 480px) {
    .quiz-choices { grid-template-columns: 1fr; }

    .quiz-summary-actions, .quiz-start-actions { flex-direction: column; }

    .quiz-summary-actions > *, .quiz-start-actions > * { width: 100%; }
}

.deck-image {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    background-color: var(--bg-soft);
    border: 1px solid var(--line-color);
    margin-top: 0.5rem;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
}

.modal.is-open { display: flex; }

.modal-content { max-width: 95%; max-height: 90vh; object-fit: contain; }

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #fff;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    border: 0;
    background: transparent;
}

.section-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.25rem; }

.calendar-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    background-color: var(--card-bg);
    border-top: 3px solid var(--line-color);
}

.control-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.main-controls { justify-content: space-between; }

.search-box { position: relative; flex: 1; min-width: 260px; }

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
}

#cal-search-input {
    width: 100%;
    padding: 0.65rem 2.2rem 0.65rem 2.4rem;
    border: 1px solid var(--line-color);
    background-color: var(--bg-color);
    color: var(--text-main);
    font-size: 0.95rem;
    border-radius: 4px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#cal-search-input:focus { border-color: var(--brand-color); }

.btn-clear {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.view-switchers {
    display: flex;
    gap: 0.25rem;
    background-color: var(--card-bg);
    padding: 3px;
    border-radius: 6px;
}

.btn-view {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-view svg { width: 1rem; height: 1rem; }

.btn-view:hover { background-color: var(--bg-soft); }

.btn-view.active { color: var(--brand-color); }

.filters-row { padding-top: 0.75rem; border-top: 1px dashed var(--line-color); }

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
}

.filter-group label { font-weight: 700; color: var(--text-muted); white-space: nowrap; }

.select-styled {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--line-color);
    background-color: var(--card-bg);
    color: var(--text-main);
    border-radius: 4px;
    font-size: 0.88rem;
    cursor: pointer;
}

.checkbox-group { margin-left: auto; }

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    user-select: none;
    font-weight: 700;
}

.checkbox-label input { accent-color: var(--brand-color); width: 1rem; height: 1rem; }

.status-row {
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.result-count strong { font-size: 1.05rem; }

.btn-reset-text {
    background: none;
    border: none;
    color: var(--text-main);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.82rem;
}

.cal-view { display: none; }

.cal-view.active { display: block; }

.events-grid { display: flex; flex-direction: column; gap: 1rem; }

.event-card {
    background-color: var(--card-bg);
    border: 1px solid var(--line-color);
    border-left: 4px solid var(--line-color);
    padding: 1.15rem 1.25rem;
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.event-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
    margin: 0;
    padding: 0;
    border: 0;
}

.event-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    background-color: var(--bg-soft);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 3px;
    white-space: nowrap;
    margin-left: 0.3rem;
}

.event-badge:first-child { margin-left: 0; }

.event-badge-weekday { background-color: var(--line-color); color: var(--text-muted); }

.event-badge-holiday { background-color: #ffe0e0; color: #c0392b; }

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}

.meta-item { display: inline-flex; align-items: center; gap: 0.35rem; }

.meta-item svg {
    width: 0.95rem;
    height: 0.95rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--line-color);
    font-size: 0.82rem;
}

.days-left { font-weight: 700; }

.btn-add-gcal {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-link);
    text-decoration: none;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--line-color);
    background-color: var(--bg-soft);
    border-radius: 3px;
    transition: background-color 0.15s;
}

.btn-add-gcal:hover { background-color: var(--bg-hover); color: var(--text-link-hover); }

.skeleton-card {
    height: 110px;
    background: linear-gradient(90deg, var(--bg-soft) 25%, var(--bg-hover) 50%, var(--bg-soft) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }

    100% { background-position: -200% 0; }
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    background-color: var(--card-bg);
    padding: 0.75rem 1rem;
    border: 1px solid var(--line-color);
}

.btn-month-nav {
    background: var(--bg-soft);
    border: 1px solid var(--line-color);
    padding: 0.4rem 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--line-color);
    border: 1px solid var(--line-color);
}

.month-day-head {
    background-color: var(--bg-soft);
    color: var(--text-main);
    text-align: center;
    padding: 0.5rem;
    font-weight: 700;
    font-size: 0.8rem;
}

.month-day-cell { background-color: var(--card-bg); min-height: 85px; padding: 0.35rem; }

.month-day-cell.other-month { opacity: 0.4; background-color: var(--bg-soft); }

.day-number { font-size: 0.8rem; font-weight: 700; margin-bottom: 0.25rem; }

.month-day-cell.today .day-number {
    background-color: var(--brand-color);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    max-height: 60px;
}

.mini-event-pill {
    background-color: var(--bg-soft);
    color: var(--text-main);
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 2px;
    border: 0;
    font-family: inherit;
    text-align: left;
}

.calendar-search-button { margin-right: 15px; }

.calendar-empty-message { padding: 1rem; }

.result-count.is-error { color: var(--red-700); font-weight: 700; }

.event-modal-content {
    width: min(500px, 95%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--card-bg);
    color: var(--text-main);
    padding: 1.25rem;
    border-radius: 8px;
    position: relative;
    cursor: default;
}

.event-modal-close {
    position: absolute;
    right: 1.25rem;
    top: 0.75rem;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
}

.event-modal-title { margin: 0; padding-right: 2.5rem; color: var(--text-main); }

.event-modal-details { margin-top: 0.95rem; line-height: 1.6; }

.event-modal-row { margin-bottom: 0.65rem; }

.event-modal-description-label { margin-bottom: 0.3rem; }

.event-modal-description {
    font-size: 0.9em;
    background: var(--bg-color);
    padding: 0.65rem;
    border-radius: 4px;
    max-height: 180px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.event-modal-description a { color: var(--text-link); overflow-wrap: anywhere; text-decoration: underline; }

.event-modal-description table {
    width: 100%;
    margin: 0.5rem 0;
    border-collapse: collapse;
    white-space: normal;
}

.event-modal-description th,
.event-modal-description td {
    padding: 0.35rem;
    border: 1px solid var(--line-color);
    text-align: left;
    vertical-align: top;
}

#modal-event-location a { color: var(--text-link); text-decoration: underline; }

.event-modal-navigation {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.25rem;
    border-top: 1px solid var(--line-color);
    padding-top: 0.95rem;
}

.event-modal-nav-button { padding: 0.3rem 0.95rem; font-size: 0.9em; }

@media (max-width: 600px) {
    .control-row { flex-direction: column; align-items: stretch; }

    .checkbox-group { margin-left: 0; }

    .month-day-cell { min-height: 60px; }
}

.month-day-cell {
    display: flex;
    flex-direction: column;
    height: 120px;
    overflow: hidden;
    position: relative;
}

.day-more-toggle {
    display: block;
    width: 100%;
    margin-top: 2px;
    padding: 1px 2px;
    background: none;
    border: none;
    color: var(--text-link);
    font-size: 0.68rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    flex-shrink: 0;
}

.day-more-toggle:hover { text-decoration: underline; }

.day-popover {
    position: fixed;
    z-index: 300;
    display: flex;
    flex-direction: column;
    width: min(320px, 90vw);
    max-height: min(420px, 70vh);
    background-color: var(--card-bg);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.day-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    background-color: var(--bg-soft);
    border-bottom: 1px solid var(--line-color);
    flex-shrink: 0;
}

.day-popover-header h4 { margin: 0; font-size: 0.92rem; color: var(--text-main); }

.day-popover-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.15rem;
    flex-shrink: 0;
}

.day-popover-close:hover { color: var(--text-main); }

.day-popover-list { overflow-y: auto; padding: 0.4rem; }

.day-popover-event {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: baseline;
    padding: 0.6rem 0.65rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    width: 100%;
    border: 0;
    background: transparent;
    font-family: inherit;
    text-align: left;
}

.day-popover-event:hover { background-color: var(--bg-soft); }

.day-popover-event-time {
    flex-shrink: 0;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.day-popover-event-name { color: var(--text-main); }

.day-events { flex: 1; overflow: visible; padding-right: 4px; }

.mini-event-pill {
    flex-shrink: 0;
    min-height: 24px;
    margin-bottom: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-card { cursor: pointer; }

.month-day-head.sunday, .month-day-cell.sunday { background-color: #fff5f5; color: #d9534f; }

.month-day-head.saturday, .month-day-cell.saturday { background-color: #f0f8ff; color: #0275d8; }

.month-day-cell.holiday { background-color: #fff5f5; }

.month-day-cell.holiday .day-number { cursor: help; }

.winner-posts-page { max-width: 760px; margin-inline: auto; min-width: 0; }

.winner-posts-intro > p { margin-bottom: 0.35rem; }

.winner-posts-intro summary {
    width: fit-content;
    color: var(--text-main);
    font-weight: 700;
    cursor: pointer;
}

.winner-posts-intro-details { margin-top: 0.75rem; line-height: 1.5; }

.winner-posts-intro-details p { margin-bottom: 0.2rem; }

.winner-posts-intro-details p:last-child { margin-bottom: 0; }

.winner-posts-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
}

.winner-posts-filters label {
    display: grid;
    gap: 0.35rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.winner-posts-filters input,
.winner-posts-filters select {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--line-color);
    background: var(--card-bg);
    color: var(--text-main);
    font: inherit;
}

.winner-posts-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.feed-status { margin: 1rem 0; color: var(--text-muted); text-align: center; }

.feed-status:empty { display: none; }

.feed-retry {
    border: 0;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.page-ellipsis { align-self: center; padding: 0 0.2rem; color: var(--text-muted); }

@media (max-width: 600px) {
    .winner-posts-filters { grid-template-columns: 1fr; }

    .winner-posts-filter-actions { grid-column: auto; align-items: stretch; flex-direction: column; }

    #winner-posts-pagination { flex-wrap: wrap; }
}

.winner-posts-feed {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
    max-width: 100%;
}

.winner-post-card {
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.winner-post-card h3 { margin: 0 0 0.35rem; color: var(--text-main); }

.winner-post-meta { margin: 0 0 0.75rem; color: var(--text-muted); font-size: 0.9rem; }

.x-embed-slot {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 120px;
    display: grid;
    place-items: center;
    overflow-x: hidden;
}

.x-embed-slot iframe { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }

.x-embed-slot[aria-busy="true"]::before { content: "Xの投稿を読み込んでいます…"; color: var(--text-muted); font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.feed-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.feed-pagination[hidden] { display: none; }

.feed-pagination button { min-width: 5rem; padding: 0.55rem 0.85rem; cursor: pointer; }

.admin-toolbar,
.admin-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.main-content:has(.admin-toolbar, .admin-login-box) .page-title {
    margin-block: 2rem 1.25rem;
    padding: 0;
    border: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.admin-toolbar, .admin-post-card {
    padding: 1rem 0;
    border: 0;
    border-top: 1px solid var(--line-color);
    background: transparent;
}

.admin-toolbar form { margin-inline-start: auto; }

.admin-post-card { overflow-wrap: anywhere; }

.admin-post-state {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.admin-visibility-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 6em;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-weight: 700;
    line-height: 1.7;
    white-space: nowrap;
}

.admin-post-card[data-visibility="public"] .admin-visibility-badge {
    background: var(--tri-pale);
    color: var(--tri-dark);
}

.admin-setting {
    flex: 0 0 10em;
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

.admin-post-detail { color: var(--text-muted); font-size: 0.85rem; }

.admin-post-card > h2 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    padding: 0;
    border: 0;
}

.admin-actions { margin-top: 0.75rem; }

.admin-x-embed { margin-top: 1rem; }

.admin-toolbar button, .admin-actions button, .admin-login-box button, #admin-pagination button {
    min-height: 44px;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--text-muted);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-main);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.admin-toolbar button:not(:disabled):hover, .admin-actions button:not(:disabled):hover,
#admin-pagination button:not(:disabled):hover { background: var(--bg-soft); }

.admin-actions button[aria-pressed="true"] {
    border-color: var(--brand-color);
    background: var(--bg-soft);
    color: var(--brand-hover);
}

.admin-login-box { max-width: 27rem; padding: 1rem 0; border: 0; background: transparent; }

.admin-login-box form { display: grid; gap: 0.75rem; }

.admin-login-box input {
    width: 100%;
    min-height: 48px;
    padding: 0.7rem;
    border: 1px solid var(--text-muted);
    border-radius: 6px;
    font: inherit;
}

.admin-login-box button {
    justify-self: start;
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: #fff;
}

.admin-login-box button:hover { background: var(--brand-hover); }

.admin-login-box button:active { background: var(--brand-active); }

.page-btn:disabled,
.quiz-choice:disabled:where(:not(.is-correct-choice, .is-selected-incorrect)),
.feed-pagination button:disabled,
.admin-toolbar button:disabled,
.admin-actions button:disabled,
#admin-pagination button:disabled {
    color: var(--text-disabled);
    background: var(--bg-soft);
    border-color: var(--line-color);
    cursor: default;
}
