/* =========================================================
   堀川アクティブポイント
   共通レスポンシブスタイル
   ========================================================= */

:root {
    --brand: #ed7d22;
    --brand-dark: #d96810;
    --brand-soft: #fff3e6;
    --bg: #f8f6f3;
    --panel: #ffffff;
    --text: #2f3337;
    --muted: #687078;
    --border: #ddd8d2;
    --admin: #33383d;
    --success-bg: #e8f5e9;
    --success-text: #256029;
    --error-bg: #fdecea;
    --error-text: #a12622;
    --control-height: 48px;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    padding-bottom: 76px;
    background: var(--bg);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Hiragino Kaku Gothic ProN",
        "Yu Gothic",
        "YuGothic",
        "Meiryo",
        sans-serif;
    font-size: 16px;
    line-height: 1.65;
}

a {
    color: #1769aa;
}

img {
    max-width: 100%;
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
    font-size: 16px;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

input,
select,
textarea {
    color: var(--text);
}

/* =========================================================
   公開画面
   ========================================================= */

.header {
    background: linear-gradient(135deg, #ed7d22, #f5a13d);
    color: #fff;
    padding: 24px 18px;
}

.header-inner,
.admin-head-inner {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
}

.association {
    font-size: 14px;
    line-height: 1.4;
}

.header h1 {
    margin: 5px 0 0;
    font-size: clamp(22px, 4.5vw, 30px);
    line-height: 1.3;
}

.container {
    width: min(100% - 24px, 780px);
    margin: 0 auto;
    padding: 18px 0;
}

.event-card,
.detail-card,
.next-card,
.ranking-card,
.summary-box {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .07);
}

.event-date,
.next-date {
    color: var(--brand-dark);
    font-size: 15px;
    font-weight: 800;
}

.event-name,
.next-name {
    margin: 7px 0 0;
    font-size: 21px;
    line-height: 1.45;
}

.detail-title {
    margin: 0 0 14px;
    font-size: 24px;
    line-height: 1.4;
}

.event-venue {
    margin-top: 10px;
    color: var(--muted);
}

.badges {
    margin-top: 12px;
}

.badge {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 20px;
    margin: 0 5px 5px 0;
    font-size: 13px;
    line-height: 1.4;
}

.badge.point {
    background: #fff0df;
    color: #c65f08;
}

.badge.status {
    background: #eef2f4;
    color: #56636b;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: var(--control-height);
    margin-top: 18px;
    padding: 11px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--brand-dark);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(237, 125, 34, .28);
    outline-offset: 2px;
}

.button:disabled {
    opacity: .6;
    cursor: default;
}

.button.inline {
    display: inline-flex;
    width: auto;
    min-width: 130px;
    margin: 0;
}

.button.secondary {
    background: #646b70;
}

.button.secondary:hover {
    background: #51575b;
}

.empty {
    background: #fff;
    padding: 32px 18px;
    text-align: center;
    border-radius: 10px;
    color: #777;
}

.detail-row {
    padding: 16px 0;
    border-top: 1px solid #eee;
}

.detail-label {
    margin-bottom: 4px;
    color: #737b82;
    font-size: 14px;
    font-weight: 700;
}

.detail-value {
    font-size: 16px;
    line-height: 1.75;
}

.pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.next-label {
    margin-bottom: 9px;
    color: var(--brand-dark);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .03em;
}

.bottom-nav {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid #ded8d2;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .05);
}

.bottom-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 58px;
    padding: 10px 6px;
    color: #666;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
}

.bottom-nav a.active {
    color: var(--brand-dark);
    background: #fff7ef;
}

/* 順位 */

.ranking-description {
    margin-top: 0;
    color: #606970;
    font-size: 16px;
    line-height: 1.75;
}

.ranking-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.rank-number {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff0df;
    color: #d66c10;
    font-size: 18px;
    font-weight: 800;
}

.ranking-town {
    overflow-wrap: anywhere;
    font-size: 17px;
    font-weight: 800;
}

.ranking-raw {
    margin-top: 4px;
    color: #616970;
    font-size: 14px;
}

.ranking-adjusted {
    margin-top: 2px;
    color: #858b90;
    font-size: 13px;
}

.sports-day-score {
    text-align: right;
    white-space: nowrap;
}

.sports-day-score strong {
    display: block;
    color: var(--brand-dark);
    font-size: 22px;
}

.sports-day-score span {
    color: #777;
    font-size: 12px;
}

.updated {
    margin-top: 18px;
    color: #777;
    font-size: 13px;
    text-align: center;
}

.season-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 11px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .2);
    font-size: 13px;
    font-weight: 700;
}

/* =========================================================
   管理画面共通
   ========================================================= */

.admin-header {
    background: var(--admin);
    color: #fff;
    padding: 16px 18px;
}

.admin-head-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.admin-head-inner h1 {
    margin: 0;
    font-size: clamp(20px, 3.2vw, 27px);
    line-height: 1.35;
}

.admin-head-inner nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.admin-head-inner nav a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 11px;
    border-radius: 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.admin-head-inner nav a:hover {
    background: rgba(255, 255, 255, .1);
}

.admin-container {
    width: min(100% - 32px, 1180px);
    margin: 0 auto;
    padding: 24px 0 36px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.message {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.6;
}

.message.success {
    background: var(--success-bg);
    color: var(--success-text);
}

.message.error {
    background: var(--error-bg);
    color: var(--error-text);
}

/* 管理フォーム */

.admin-form,
.select-event,
.fiscal-select,
.copy-box {
    background: #fff;
    border-radius: 11px;
}

.admin-form {
    padding: 24px;
}

.admin-form label,
.select-event label,
.fiscal-select label,
.copy-form label {
    display: block;
    color: #34383c;
    font-size: 16px;
    font-weight: 800;
}

.admin-form label {
    margin-bottom: 18px;
}

.admin-form input,
.admin-form textarea,
.admin-form select,
.select-event select,
.fiscal-select select,
.copy-form select,
.liff-select {
    width: 100%;
    min-height: var(--control-height);
    margin-top: 7px;
    padding: 10px 12px;
    border: 1px solid #bfc4c8;
    border-radius: 7px;
    background: #fff;
    color: #25292c;
    font-size: 16px;
    line-height: 1.4;
}

.admin-form textarea {
    min-height: 130px;
    resize: vertical;
    padding-top: 12px;
    line-height: 1.65;
}

.admin-form small {
    display: block;
    margin-top: 6px;
    color: #6f777d;
    font-size: 14px;
    font-weight: 400;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 28px;
    margin: 6px 0 10px;
}

.check-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.check-row input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
    margin: 0;
    accent-color: var(--brand);
}

.select-event {
    padding: 18px;
    margin-bottom: 18px;
}

.summary-box {
    font-size: 16px;
    line-height: 1.8;
}

.readonly-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    padding: 14px;
    margin-bottom: 18px;
    background: #f3f4f4;
    border-radius: 8px;
    font-size: 15px;
}

.cancel-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 14px;
    padding: 5px 0;
    color: #606970;
    font-size: 15px;
}

/* 管理テーブル */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .04);
}

.admin-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
    font-size: 15px;
}

.admin-table th,
.admin-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e8e8e8;
    vertical-align: middle;
    text-align: center;
}

.admin-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--brand-soft);
    color: #75420f;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
}

.admin-table td {
    background: #fff;
}

.admin-table .left {
    text-align: left;
}

.admin-table a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 5px 6px;
    font-weight: 700;
}

.input-table {
    min-width: 960px;
}

.input-table input[type="number"] {
    width: 82px;
    min-height: 44px;
    padding: 8px 9px;
    border: 1px solid #bdc2c6;
    border-radius: 7px;
    font-size: 16px;
    text-align: right;
}

.input-table td:nth-child(2) {
    min-width: 210px;
}

.summary-line {
    margin: 12px 0;
    color: #5e666d;
    font-size: 15px;
}

.missing {
    color: #b3261e;
    font-weight: 800;
}

.inactive-row td {
    background: #f3f3f3;
    color: #7a8085;
}

/* =========================================================
   町内管理
   ========================================================= */

.town-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 18px;
}

.fiscal-select {
    padding: 14px 16px;
}

.fiscal-select select {
    min-width: 190px;
}

.town-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 0;
}

.copy-box {
    padding: 18px;
    margin-bottom: 18px;
}

.copy-box p {
    margin: 7px 0 14px;
    color: #606970;
    font-size: 15px;
    line-height: 1.75;
}

.copy-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
}

.copy-form select {
    min-width: 200px;
}

.merge-explanation {
    margin: 16px 0;
    padding: 15px 16px;
    background: #fff7ef;
    border-radius: 8px;
    color: #69482c;
    font-size: 15px;
    line-height: 1.75;
}

.merge-year {
    display: inline-block;
}

.merge-form {
    margin-top: 16px;
}

.admin-section-title {
    margin: 30px 0 14px;
    font-size: 20px;
}

.inline-form {
    display: inline;
}

.text-danger,
.text-button {
    min-height: 42px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.text-danger {
    color: #b3261e;
    font-size: 15px;
    text-decoration: underline;
}

/* =========================================================
   LINE MINI App / LIFF
   ========================================================= */

.liff-body {
    padding-bottom: max(26px, env(safe-area-inset-bottom));
    background: #f7f4ef;
}

.liff-header {
    background: linear-gradient(135deg, #ed7d22, #f5a13d);
    color: #fff;
    padding:
        calc(20px + env(safe-area-inset-top))
        18px
        20px;
}

.liff-header-inner {
    width: min(100%, 780px);
    margin: 0 auto;
}

.liff-header h1 {
    margin: 5px 0 0;
    font-size: clamp(22px, 6vw, 29px);
    line-height: 1.35;
}

.liff-container {
    width: min(100% - 24px, 780px);
    margin: 0 auto;
    padding: 16px 0 26px;
}

.liff-hidden {
    display: none !important;
}

.liff-status {
    padding: 30px 16px;
    color: #70777d;
    font-size: 16px;
    text-align: center;
}

.profile-card,
.liff-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 15px;
    box-shadow: 0 2px 9px rgba(0, 0, 0, .07);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 13px;
}

.profile-image {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-caption {
    color: #777f85;
    font-size: 13px;
}

.profile-name {
    margin-top: 2px;
    font-size: 20px;
    font-weight: 800;
}

.liff-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.45;
}

.liff-card p {
    margin: 0 0 15px;
    color: #5f676d;
    font-size: 16px;
    line-height: 1.75;
}

.liff-card-caption {
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 800;
}

.liff-select {
    margin-top: 0;
}

.my-town-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin-top: 15px;
}

.my-town-stat {
    min-width: 0;
    padding: 12px 6px;
    border-radius: 9px;
    background: #fff7ef;
    text-align: center;
}

.my-town-stat span {
    display: block;
    color: #806149;
    font-size: 12px;
    line-height: 1.35;
}

.my-town-stat strong {
    display: block;
    margin-top: 5px;
    color: #c65f08;
    font-size: 21px;
    line-height: 1.25;
}

.text-button {
    display: block;
    margin: 13px auto 0;
    padding: 6px 8px;
    color: #626a70;
    font-size: 15px;
    text-decoration: underline;
}

.liff-menu {
    display: grid;
    gap: 11px;
}

.liff-menu-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 13px;
    min-height: 82px;
    padding: 15px;
    border-radius: 13px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 1px 7px rgba(0, 0, 0, .06);
}

.liff-menu-icon {
    grid-row: 1 / 3;
    align-self: center;
    font-size: 30px;
}

.liff-menu-card strong {
    align-self: end;
    font-size: 17px;
}

.liff-menu-card small {
    align-self: start;
    margin-top: 3px;
    color: #777f85;
    font-size: 14px;
}

/* =========================================================
   タブレット以下
   ========================================================= */

@media (max-width: 820px) {
    .admin-head-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-head-inner nav {
        justify-content: flex-start;
        width: 100%;
    }

    .admin-head-inner nav a {
        margin: 0;
    }

    .admin-container {
        width: min(100% - 22px, 1180px);
        padding-top: 16px;
    }

    .town-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .fiscal-select,
    .fiscal-select select {
        width: 100%;
    }
}

/* =========================================================
   スマートフォン
   ========================================================= */

@media (max-width: 640px) {
    body {
        padding-bottom: 72px;
        font-size: 16px;
    }

    .header {
        padding: 20px 14px;
    }

    .container {
        width: min(100% - 18px, 780px);
        padding: 10px 0 16px;
    }

    .event-card,
    .detail-card,
    .next-card,
    .ranking-card,
    .summary-box {
        padding: 16px;
        margin-bottom: 11px;
        border-radius: 10px;
    }

    .event-name,
    .next-name {
        font-size: 19px;
    }

    .detail-title {
        font-size: 21px;
    }

    .bottom-nav a {
        min-height: 56px;
        font-size: 12px;
    }

    .ranking-card {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 8px 10px;
    }

    .rank-number {
        grid-row: 1 / 3;
        width: 42px;
        height: 42px;
    }

    .sports-day-score {
        grid-column: 2;
        text-align: left;
    }

    .sports-day-score strong,
    .sports-day-score span {
        display: inline;
    }

    .sports-day-score span {
        margin-left: 6px;
    }

    .admin-header {
        padding: 13px 11px;
    }

    .admin-head-inner {
        gap: 8px;
    }

    .admin-head-inner nav {
        gap: 4px;
    }

    .admin-head-inner nav a {
        min-height: 40px;
        padding: 7px 8px;
        font-size: 14px;
    }

    .admin-container {
        width: min(100% - 16px, 1180px);
        padding: 12px 0 30px;
    }

    .admin-form {
        padding: 15px;
    }

    .admin-form label,
    .select-event label,
    .fiscal-select label,
    .copy-form label {
        font-size: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .check-row {
        flex-direction: column;
        gap: 12px;
    }

    .button.inline {
        width: 100%;
    }

    .admin-actions,
    .town-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .table-wrap {
        margin-left: 0;
        margin-right: 0;
        border: 1px solid #ece8e4;
    }

    .admin-table {
        font-size: 14px;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
    }

    .input-table input[type="number"] {
        width: 78px;
        min-height: 46px;
        font-size: 16px;
    }

    .copy-form {
        display: block;
    }

    .copy-form select {
        width: 100%;
        min-width: 0;
    }

    .copy-form .button {
        width: 100%;
        margin-top: 11px;
    }

    .readonly-box {
        display: block;
    }

    .readonly-box span {
        display: block;
        margin-top: 5px;
    }

    .liff-header {
        padding:
            calc(17px + env(safe-area-inset-top))
            14px
            17px;
    }

    .liff-container {
        width: min(100% - 18px, 780px);
        padding-top: 10px;
    }

    .profile-card,
    .liff-card {
        padding: 15px;
        margin-bottom: 11px;
    }

    .my-town-grid {
        gap: 6px;
    }

    .my-town-stat {
        padding: 10px 4px;
    }

    .my-town-stat span {
        font-size: 11px;
    }

    .my-town-stat strong {
        font-size: 18px;
    }
}

/* =========================================================
   小さいスマートフォン
   ========================================================= */

@media (max-width: 390px) {
    .association {
        font-size: 13px;
    }

    .admin-head-inner nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-head-inner nav a {
        justify-content: center;
        border: 1px solid rgba(255, 255, 255, .12);
    }

    .my-town-grid {
        grid-template-columns: 1fr;
    }

    .my-town-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
        text-align: left;
    }

    .my-town-stat strong {
        margin-top: 0;
    }
}


/* =========================================================
   町内一括編集
   ========================================================= */

.town-bulk-table {
    min-width: 1040px;
}

.town-bulk-table input[type="text"],
.town-bulk-table input[type="number"],
.town-bulk-table input[type="date"] {
    width: 100%;
    min-height: 46px;
    padding: 8px 9px;
    border: 1px solid #bdc2c6;
    border-radius: 7px;
    background: #fff;
    font-size: 16px;
}

.town-bulk-table td:nth-child(1) {
    width: 90px;
}

.town-bulk-table .bulk-town-name {
    min-width: 300px;
}

.town-bulk-table td:nth-child(3) {
    width: 120px;
}

.town-bulk-table td:nth-child(4) {
    width: 170px;
}

.town-bulk-table td:nth-child(5) {
    width: 100px;
}

.bulk-checkbox {
    width: 24px;
    height: 24px;
    accent-color: var(--brand);
}

.sticky-save {
    position: sticky;
    bottom: 10px;
    z-index: 5;
    max-width: 320px;
    margin: 14px 0 0 auto;
    padding: 8px;
    border-radius: 10px;
    background: rgba(248, 246, 243, .94);
    backdrop-filter: blur(4px);
}

.sticky-save .button {
    margin: 0;
}

/* =========================================================
   LINE登録者管理・個別メッセージ
   ========================================================= */

.users-table {
    min-width: 980px;
}

.user-line-profile {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-line-profile img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.user-actions {
    white-space: nowrap;
}

.user-actions a {
    margin-right: 6px;
}

.admin-user-profile {
    margin-bottom: 18px;
    box-shadow: none;
    background: #f7f7f7;
}

.recipient-box {
    margin-bottom: 18px;
    padding: 15px;
    border-radius: 9px;
    background: #f4f5f5;
    font-size: 16px;
}

.recipient-town {
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
}

.message-form textarea {
    min-height: 220px;
}

.help-text {
    margin: -5px 0 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
}

/* LIFF 本名入力 */

.liff-field {
    display: block;
    margin-bottom: 14px;
    color: #34383c;
    font-size: 16px;
    font-weight: 800;
}

.liff-field > span {
    display: block;
    margin-bottom: 6px;
}

.liff-input {
    width: 100%;
    min-height: var(--control-height);
    padding: 10px 12px;
    border: 1px solid #bfc4c8;
    border-radius: 7px;
    background: #fff;
    color: #25292c;
    font-size: 16px;
}

@media (max-width: 640px) {
    .sticky-save {
        max-width: none;
        width: 100%;
    }
}


/* =========================================================
   ポイント制度
   ========================================================= */

.point-rule-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.point-rule-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 15px;
    border-radius: 9px;
    background: #fff7ef;
    font-size: 16px;
}

.point-rule-row strong {
    color: var(--brand-dark);
    white-space: nowrap;
}

.sports-score-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0;
}

.sports-score-grid > div {
    padding: 11px 6px;
    border: 1px solid #e4ddd5;
    border-radius: 9px;
    background: #fffaf5;
    text-align: center;
}

.sports-score-grid strong,
.sports-score-grid span {
    display: block;
}

.sports-score-grid span {
    margin-top: 3px;
    color: var(--brand-dark);
    font-size: 19px;
    font-weight: 800;
}

/* =========================================================
   お問い合わせ（LINE Webhook）
   ========================================================= */

.inquiry-list {
    display: grid;
    gap: 12px;
}

.inquiry-card {
    padding: 17px;
    border: 1px solid #e4e1dd;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .04);
}

.inquiry-card.unread {
    border-left: 5px solid var(--brand);
    background: #fffaf5;
}

.inquiry-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
}

.inquiry-head time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
}

.inquiry-town {
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
}

.inquiry-text {
    margin-top: 14px;
    padding: 13px 14px;
    border-radius: 9px;
    background: #f6f7f7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 16px;
    line-height: 1.7;
}

.inquiry-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 13px;
}

.inquiry-actions form {
    margin: 0;
}

@media (max-width: 640px) {
    .sports-score-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .inquiry-head {
        display: block;
    }

    .inquiry-head time {
        display: block;
        margin-top: 8px;
    }

    .inquiry-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .inquiry-actions .button.inline {
        width: 100%;
    }
}


/* =========================================================
   LINE MINI App 内ページ
   ========================================================= */

.liff-bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid #ded8d2;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .05);
}

.liff-bottom-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 8px 4px;
    color: #666;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.liff-event-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.liff-event-link:hover {
    text-decoration: none;
}

.liff-event-date {
    margin-top: 10px;
    color: var(--brand-dark);
    font-size: 16px;
    font-weight: 800;
}

.liff-event-meta {
    margin-top: 7px;
    color: var(--muted);
    font-size: 15px;
}

@media (max-width: 390px) {
    .liff-bottom-nav a {
        font-size: 12px;
    }
}


/* LINE登録者：初回登録テスト用リセット */
.user-actions .inline-form {
    display: inline-block;
    margin: 0;
}

.user-actions .text-danger {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 5px 6px;
    font-size: 14px;
}

@media (max-width: 640px) {
    .user-actions {
        min-width: 190px;
    }
}


/* =========================================================
   v4.3 LINE MINI App UI
   ========================================================= */

.next-event-hero {
    margin-bottom: 18px;
    padding: 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff4df, #ffe2b3);
    border: 1px solid #f4c57d;
    box-shadow: 0 5px 16px rgba(196, 99, 16, .10);
}

.next-event-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 11px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.next-event-date {
    margin-top: 13px;
    color: var(--brand-dark);
    font-size: 15px;
    font-weight: 800;
}

.next-event-hero h2 {
    margin: 6px 0 8px;
    font-size: 23px;
    line-height: 1.4;
}

.next-event-meta {
    margin-top: 5px;
    color: #5f676d;
    font-size: 15px;
}

.liff-section-heading {
    margin: 23px 2px 12px;
    font-size: 20px;
    color: #30353a;
}

/* 自分の町内を順位ページ最上部に固定表示 */
.my-ranking-hero {
    margin-bottom: 18px;
    padding: 19px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ed7d22, #f7a54f);
    color: #fff;
    box-shadow: 0 5px 16px rgba(148, 68, 9, .18);
}

.my-ranking-label {
    font-size: 13px;
    font-weight: 800;
    opacity: .9;
}

.my-ranking-town {
    margin-top: 3px;
    font-size: 23px;
    font-weight: 800;
}

.my-ranking-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.my-ranking-stats > div {
    padding: 10px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .16);
    text-align: center;
}

.my-ranking-stats span {
    display: block;
    font-size: 11px;
    line-height: 1.35;
}

.my-ranking-stats strong {
    display: block;
    margin-top: 5px;
    font-size: 18px;
    line-height: 1.3;
}

/* ポイント制度 */
.point-rule-cards {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.point-rule-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 13px;
    border-radius: 13px;
    background: linear-gradient(135deg, #fff8ec, #fff0d8);
    border: 1px solid #f1d2a7;
}

.point-rule-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8b52a, #ed7d22);
    color: #fff;
    font-size: 21px;
    font-weight: 900;
    box-shadow: 0 3px 8px rgba(187, 92, 14, .18);
}

.point-rule-copy span {
    display: block;
    color: #4d5257;
    font-size: 16px;
}

.point-rule-copy strong {
    display: block;
    margin-top: 2px;
    color: #c85f08;
    font-size: 19px;
}

/* 登録画面は登録に集中させる */
#townRegistration {
    margin-bottom: 0;
}

@media (max-width: 420px) {
    .my-ranking-stats {
        grid-template-columns: 1fr;
    }

    .my-ranking-stats > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 10px 12px;
    }

    .my-ranking-stats strong {
        margin-top: 0;
    }
}


/* =========================================================
   v4.4 LIFF下部メニュー・ポイント表示
   ========================================================= */

/* 3項目に絞り、アイコン＋正式名称で分かりやすく */
.liff-bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid #e7dfd7;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
}

.liff-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 58px;
    padding: 6px 4px;
    border-radius: 10px;
    color: #6e6259;
    text-decoration: none;
    font-weight: 700;
}

.liff-bottom-nav a.active {
    background: #fff0df;
    color: #c85f08;
}

.liff-bottom-nav .nav-icon {
    font-size: 22px;
    line-height: 1;
}

.liff-bottom-nav .nav-label {
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}

/* ポイント制度の単位表示 */
.point-rule-copy strong {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
}

.point-rule-suffix {
    color: #7b6657;
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 360px) {
    .liff-bottom-nav .nav-label {
        font-size: 11px;
    }

    .liff-bottom-nav .nav-icon {
        font-size: 20px;
    }
}


/* =========================================================
   v4.5 イベントPDF
   ========================================================= */

.admin-upload-box {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid #e4ddd5;
    border-radius: 12px;
    background: #fffaf5;
}

.admin-upload-title {
    margin-bottom: 12px;
    color: #5b4635;
    font-size: 17px;
    font-weight: 800;
}

.admin-upload-box input[type="file"] {
    min-height: 48px;
    padding: 8px;
    background: #fff;
}

.current-pdf {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding: 13px;
    border-radius: 9px;
    background: #fff;
}

.current-pdf-name {
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.delete-pdf-check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    margin: 0 0 15px !important;
    color: #9a3027 !important;
}

.delete-pdf-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
    margin: 0;
}

.event-pdf-actions {
    margin-top: 8px;
}

.pdf-open-button {
    margin-top: 0;
}

.event-pdf-preview {
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid #ddd8d2;
    border-radius: 10px;
    background: #f1f1f1;
}

.event-pdf-preview iframe {
    display: block;
    width: 100%;
    height: 720px;
    border: 0;
}

@media (max-width: 700px) {
    .current-pdf {
        align-items: stretch;
        flex-direction: column;
    }

    .current-pdf .button.inline {
        width: 100%;
    }

    /* スマホ・LINE内ブラウザではプレビューを出さず、
       「PDFを開く」ボタンを基本導線にする。 */
    .event-pdf-preview {
        display: none;
    }

    .pdf-open-button {
        width: 100%;
    }
}

/* =========================================================
   v4.6 LIFF 登録情報の確認・変更
   ========================================================= */

.registration-summary {
    margin: 16px 0 18px;
    overflow: hidden;
    border: 1px solid #eadfd5;
    border-radius: 12px;
    background: #fffaf5;
}

.registration-summary-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 12px 14px;
    border-bottom: 1px solid #eadfd5;
}

.registration-summary-row:last-child {
    border-bottom: 0;
}

.registration-summary-row span {
    color: #7a6b60;
    font-size: 14px;
    font-weight: 700;
}

.registration-summary-row strong {
    color: #30353a;
    font-size: 18px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.confirm-summary {
    background: #fff7ed;
    border-color: #f1cfaa;
}

.profile-action-grid {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.profile-action-grid .button {
    width: 100%;
    margin: 0;
}

.profile-change-note {
    margin-top: 4px !important;
    padding: 12px 13px;
    border-radius: 9px;
    background: #f7f4ef;
    color: #666 !important;
    font-size: 14px !important;
    line-height: 1.65 !important;
}

@media (max-width: 420px) {
    .registration-summary-row {
        grid-template-columns: 72px minmax(0, 1fr);
        min-height: 60px;
        padding: 11px 12px;
    }

    .registration-summary-row strong {
        font-size: 17px;
    }
}


/* =========================================================
   v4.7 PC・Mac向けWebメニュー
   ========================================================= */
.web-menu-container {
    max-width: 960px;
}

.web-menu-intro {
    margin-bottom: 18px;
}

.web-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.web-menu-tile {
    display: flex;
    min-height: 180px;
    padding: 24px;
    border: 1px solid #f0c18f;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff9f0, #fff0dd);
    box-shadow: 0 7px 20px rgba(80, 52, 29, .08);
    color: #3b3028;
    text-align: center;
    text-decoration: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.web-menu-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(80, 52, 29, .13);
}

.web-menu-tile strong {
    font-size: 24px;
}

.web-menu-tile > span:last-child {
    color: #7c6f64;
    font-size: 14px;
}

.web-menu-icon,
.web-menu-fb-icon {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    font-size: 38px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
}

.web-menu-fb-icon {
    background: #1877f2;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 52px;
    font-weight: 800;
}

@media (max-width: 680px) {
    .web-menu-grid {
        grid-template-columns: 1fr;
    }
    .web-menu-tile {
        min-height: 140px;
        padding: 18px;
    }
}

/* =========================================================
   v4.7 管理ダッシュボード
   ========================================================= */
.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding: 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff7ed, #fff);
    border: 1px solid #efd8c3;
}

.dashboard-welcome h2 {
    margin: 5px 0 7px;
}

.dashboard-welcome p {
    margin: 0;
    color: #6f6258;
}

.dashboard-next {
    min-width: 220px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff0df;
}
.dashboard-next span,
.dashboard-next b,
.dashboard-next strong { display: block; }
.dashboard-next span { color: #9b6c42; font-size: 13px; font-weight: 700; }
.dashboard-next strong { margin: 4px 0; font-size: 20px; color: #c85f08; }
.dashboard-next b { font-size: 15px; }

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.dashboard-stats a {
    display: flex;
    min-height: 126px;
    padding: 16px;
    border: 1px solid #e9e1d9;
    border-radius: 14px;
    background: #fff;
    color: #30353a;
    text-decoration: none;
    flex-direction: column;
    justify-content: center;
}
.dashboard-stats a:hover { border-color: #e7aa6f; }
.dashboard-stats span { font-weight: 700; color: #6e6259; }
.dashboard-stats strong { margin: 4px 0; font-size: 32px; line-height: 1; color: #c85f08; }
.dashboard-stats small { color: #7a7169; line-height: 1.4; }
.dashboard-stats .has-alert { border-color: #e6a09b; background: #fff6f5; }
.dashboard-stats .has-alert strong { color: #c4372f; }

.dashboard-section-title { margin: 0 0 12px; }
.dashboard-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.dashboard-menu-grid a {
    display: flex;
    min-height: 145px;
    padding: 20px;
    border: 1px solid #e8ded4;
    border-radius: 14px;
    background: #fff;
    color: #34302d;
    text-decoration: none;
    flex-direction: column;
    gap: 4px;
}
.dashboard-menu-grid a:hover { background: #fffaf5; border-color: #e7aa6f; }
.dashboard-icon { font-size: 32px; }
.dashboard-menu-grid strong { font-size: 18px; }
.dashboard-menu-grid small { color: #776c63; line-height: 1.5; }

.admin-header nav a.active { background: rgba(255,255,255,.18); }

@media (max-width: 900px) {
    .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .dashboard-welcome { align-items: stretch; flex-direction: column; }
    .dashboard-next { min-width: 0; }
    .dashboard-stats,
    .dashboard-menu-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Privacy policy
   ========================================================= */
.app-privacy-link {
    margin: 18px 0 6px;
    padding: 4px 0;
    text-align: center;
    font-size: 13px;
}

.app-privacy-link a,
.privacy-registration-note a,
.privacy-back-links a {
    color: #b95a13;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.privacy-registration-note {
    margin: 12px 0 0 !important;
    color: #71665e !important;
    font-size: 13px !important;
    line-height: 1.65 !important;
}

.privacy-container {
    max-width: 860px;
}

.privacy-card h2 {
    margin-bottom: 10px;
}

.privacy-card ul {
    margin: 8px 0 0;
    padding-left: 1.4em;
}

.privacy-card li {
    margin: 5px 0;
    line-height: 1.7;
}

.privacy-card p {
    line-height: 1.8;
}

.privacy-updated {
    margin-top: 18px !important;
    color: #746b64 !important;
    font-size: 13px !important;
}

.privacy-back-links {
    margin: 18px 0 8px;
    text-align: center;
    font-size: 14px;
}


/* =========================================================
   v4.9 Legal links
   ========================================================= */
.app-legal-links {
    margin: 18px 0 6px;
    padding: 4px 0;
    text-align: center;
    font-size: 13px;
}

.app-legal-links a,
.privacy-card a {
    color: #b95a13;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.app-legal-links span {
    margin: 0 7px;
    color: #a89c92;
}


/* =========================================================
   v4.9.1 カスタマーサポート
   ========================================================= */
.support-action {
    margin: 18px 0 12px;
}

.support-line-button {
    width: 100%;
    text-align: center;
}

.support-account-id {
    margin-top: 12px;
    font-weight: 700;
}

.support-note {
    color: var(--muted);
    font-size: 14px;
}
