:root {
    --bg: #faf9f6;
    --panel: #ffffff;
    --text: #3f3d39;
    --muted: #8c8c8c;
    --border: #e0ddd5;
    --card-default: #f2f0eb;
    --accent: #1f3a5f;
    --accent-soft: #e9eef5;
    --success: #2f6f45;
    --danger: #a33a32;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: var(--accent); }

button, input, textarea { font: inherit; }

button {
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    padding: 10px 16px;
}

button.secondary { background: #fff; color: var(--accent); }
button.danger { background: var(--danger); border-color: var(--danger); }
button:disabled { cursor: not-allowed; opacity: .45; }

.hidden { display: none !important; }

.app-shell {
    width: min(920px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.app-header {
    width: min(560px, 100%);
    margin: 0 auto 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}
.brand-mark {
    margin-bottom: 22px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .4em;
}
.app-header h1 {
    margin: 0;
    color: #35332f;
    font-family: "Times New Roman", "Yu Mincho", serif;
    font-size: 23px;
    font-weight: 300;
    letter-spacing: .16em;
}
#eventTitle { white-space: pre-line; }
.app-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-family: "Times New Roman", "Yu Mincho", serif;
    font-size: 11px;
    letter-spacing: .12em;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 2px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .025);
}

.panel h2 { font-size: 17px; margin: 0 0 16px; }
.alternate-lottery {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    max-width: 600px;
    padding: 14px 18px;
    margin: 0 auto 24px;
    color: var(--text);
    background: #dfe9ee;
    text-decoration: none;
}
.alternate-lottery:hover { background: #d3e2e9; }
.alternate-lottery:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.alternate-lottery img { display: block; width: 100%; height: auto; background: #fff; }
.alternate-lottery h2 { margin-bottom: 4px; font-size: 15px; }
.alternate-lottery p { margin: 0 0 5px; font-size: 13px; line-height: 1.6; }
.alternate-lottery-action { color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
body:has(#roomSection:not(.hidden)) .alternate-lottery { display: none; }
@media (max-width: 480px) {
    .alternate-lottery { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; padding: 12px; }
}
.form-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; margin-bottom: 14px; }
.form-row label { color: var(--muted); font-size: 13px; }

input[type="number"], input[type="text"], textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #fff;
    padding: 10px 12px;
}

textarea { min-height: 64px; resize: vertical; }
#cardCountInput { width: 90px; max-width: 100%; }
#joinPanel h2 { margin-bottom: 8px; }
.guest-name-row { display: block; }
.guest-name-row #nameInput { max-width: 360px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.notice { color: var(--muted); font-size: 12px; line-height: 1.7; }
.error { color: var(--danger); }
.success { color: var(--success); }

#googleSignInButton {
    width: 184px;
    max-width: 100%;
    min-height: 32px;
    overflow: hidden;
}

#googleSignInButton > div,
#googleSignInButton [role="button"] {
    width: 100% !important;
    max-width: 100% !important;
}

.status-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.status-badge {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--accent-soft);
    font-size: 12px;
    font-weight: 700;
}

.live-room-panel {
    overflow: hidden;
    border-color: #cbd5e1;
    border-top: 4px solid var(--accent);
    box-shadow: 0 16px 42px rgba(31, 58, 95, .08);
}

.live-room-header {
    display: grid;
    grid-template-columns: minmax(76px, 1fr) minmax(0, auto) minmax(76px, 1fr);
    align-items: flex-start;
    gap: 18px;
    margin: -22px -22px 18px;
    padding: 24px 22px 22px;
    border-bottom: 1px solid #dbe3ed;
    background: linear-gradient(135deg, #f7f9fc 0%, #edf2f7 100%);
}

.live-room-heading {
    grid-column: 2;
    min-width: 0;
    text-align: center;
}

.live-room-header .status-badge {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}

.live-room-kicker {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
}

.live-room-header h2 {
    margin: 0;
    color: #2f3540;
    font-family: "Times New Roman", "Yu Mincho", serif;
    font-size: clamp(32px, 5.5vw, 52px);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: .04em;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.live-room-panel[data-room-status="waiting"] .status-badge {
    border-color: #b8c8dc;
    background: #fff;
    color: var(--accent);
}

.live-room-panel[data-room-status="started"] .status-badge {
    border-color: #b8d1c0;
    background: #edf7f0;
    color: var(--success);
}

.live-room-panel[data-room-status="opened"] .status-badge {
    border-color: #d8d1c2;
    background: #f8f4eb;
    color: #6e6043;
}

.participant-summary {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
}

#participantCount {
    display: inline-block;
    margin: 0 6px;
    color: var(--accent);
    font-size: clamp(28px, 4vw, 34px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: .03em;
    vertical-align: -3px;
}

.room-utility-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #f0eee9;
}

button.room-utility-button {
    padding: 5px 7px;
    border-color: transparent;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
}

button.room-utility-button:hover:not(:disabled) {
    border-color: var(--border);
    background: #fafafa;
    color: var(--text);
}

.share-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: center; }
.share-grid > div,
.url-copy-row { min-width: 0; }
.url-box {
    min-width: 0;
    min-height: 44px;
    overflow: hidden;
    padding: 10px;
    border: 1px solid var(--border);
    background: #fafafa;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.url-copy-row {
    position: relative;
    margin-top: 6px;
}
.url-copy-row .url-box {
    min-width: 0;
    padding-right: 125px;
}
.url-copy-actions {
    position: absolute;
    top: 50%;
    right: 4px;
    display: flex;
    gap: 4px;
    align-items: center;
    transform: translateY(-50%);
}
.url-copy-actions button {
    position: static;
    width: auto;
    height: 28px;
    padding: 4px 8px;
    font-size: 10px;
    letter-spacing: .08em;
    white-space: nowrap;
}
button.qr-open-button { min-width: 52px; }
.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(31, 35, 40, .58);
}
.qr-dialog {
    width: min(430px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 56px rgba(0, 0, 0, .24);
}
.qr-dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    text-align: left;
}
.qr-dialog-heading p {
    margin: 0 0 3px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}
.qr-dialog-heading h2 {
    margin: 0;
    font-family: "Times New Roman", "Yu Mincho", serif;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: .05em;
}
button.qr-close-button {
    flex: none;
    width: auto;
    padding: 6px 9px;
    font-size: 11px;
}
#qrCanvas {
    display: block;
    width: min(240px, 100%);
    height: auto;
    margin-inline: auto;
}
.qr-modal-open { overflow: hidden; }

.service-guide h2,
.service-guide h3 { margin-top: 0; }

.service-guide {
    padding: 30px;
    overflow: hidden;
}

.guide-intro {
    position: relative;
    padding: 8px 0 28px;
    text-align: center;
}

.guide-intro::after {
    content: "";
    position: absolute;
    right: 18%;
    bottom: 0;
    left: 18%;
    height: 1px;
    background: var(--border);
}

.guide-kicker {
    margin: 0 0 12px;
    color: #aaa69e !important;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3em;
}

.service-guide .guide-intro h2 {
    margin: 0;
    color: #35332f;
    font-family: "Times New Roman", "Yu Mincho", serif;
    font-size: clamp(21px, 3.3vw, 30px);
    font-weight: 400;
    letter-spacing: .06em;
    line-height: 1.55;
}

.guide-intro > p:last-child {
    width: min(660px, 100%);
    margin: 18px auto 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 2;
}

.guide-section + .guide-section {
    margin-top: 34px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.guide-section:first-of-type {
    margin-top: 30px;
}

.guide-heading-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.guide-heading-row h3 {
    margin-bottom: 0;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: .04em;
}

.guide-heading-row > span {
    color: #b4b0a8;
    font-family: "Times New Roman", serif;
    font-size: 10px;
    letter-spacing: .2em;
}

.guide-section p,
.feature-list,
.operation-steps {
    color: var(--muted);
    line-height: 1.75;
}

.notice-list,
.feature-list,
.operation-steps {
    margin: 0;
    padding-left: 22px;
}

.notice-list { list-style: none; padding-left: 0; }
.notice-list li {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    color: #625f59;
    font-size: 13px;
    line-height: 1.7;
}
.notice-list time { color: var(--muted); font-size: 13px; }

.guide-lead {
    width: min(720px, 100%);
    margin: 0 0 22px;
    font-size: 13px;
}

.operation-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding-left: 0;
    list-style: none;
    counter-reset: operation-step;
}
.operation-steps li {
    position: relative;
    counter-increment: operation-step;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fafafa;
}
.operation-step-title {
    display: block;
    margin: 0 0 8px;
    color: var(--text);
}
.operation-step-title::before {
    content: counter(operation-step) ". ";
    color: var(--accent);
    font-weight: 700;
}
.operation-steps small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.65;
}
.operation-steps small b {
    color: var(--text);
    font-weight: 650;
}

.guide-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.guide-images figure { margin: 0; }
.guide-images img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #faf9f6;
    box-shadow: 0 8px 22px rgba(53, 51, 47, .06);
}
.guide-images figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.service-flow,
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.service-flow article,
.feature-grid article {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: linear-gradient(145deg, #fff, #faf9f6);
}

.service-flow article > span {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    margin-bottom: 12px;
    border: 1px solid #cfd7e2;
    border-radius: 50%;
    color: var(--accent);
    font-family: "Times New Roman", serif;
    font-size: 12px;
}

.service-flow strong,
.feature-grid strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    letter-spacing: .03em;
}

.service-flow p,
.feature-grid p {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.8;
}

.use-case-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.use-case-list span {
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fafafa;
    color: #625f59;
    font-size: 11px;
}

.guide-start-link {
    display: table;
    min-width: 210px;
    margin: 22px auto 0;
    padding: 11px 18px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .05em;
    text-align: center;
    text-decoration: none;
}

.guide-start-link:hover { opacity: .9; }

.host-update {
    margin-bottom: 18px;
    padding: 17px 18px 14px 20px;
    border: 1px solid #d8e1eb;
    border-left: 4px solid var(--accent);
    border-radius: 0 6px 6px 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #edf2f7 100%);
    color: #596474;
    font-size: 12px;
}

.host-update-heading {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 9px;
}

.host-update-heading span {
    padding: 4px 7px 3px;
    border-radius: 2px;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .14em;
}

.host-update-heading strong {
    color: #354357;
    font-size: 12px;
    letter-spacing: .04em;
}

.host-update-list {
    height: 112px;
    margin: 0;
    padding: 0 8px 0 0;
    overflow-y: auto;
    list-style: none;
    scrollbar-gutter: stable;
}

.host-update-item {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    padding: 10px 2px;
    border-top: 1px solid rgba(93, 112, 137, .18);
}

.host-update-item:first-child { border-top: 0; }
.host-update-item time {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--accent);
    font-size: 10px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.host-update-item:first-child time::after {
    content: "NEW";
    padding: 2px 4px;
    border: 1px solid #9fb1c7;
    border-radius: 2px;
    background: rgba(255, 255, 255, .72);
    color: var(--accent);
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .08em;
}
.host-update-item p {
    margin: 0;
    color: #4b5665;
    line-height: 1.65;
}
.host-update-message { padding: 10px 2px; color: #4b5665; }

.host-help {
    padding: 0;
    overflow: hidden;
}

.host-help > summary {
    position: relative;
    padding: 17px 48px 17px 20px;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .03em;
    list-style: none;
}

.host-help > summary::-webkit-details-marker { display: none; }

.host-help > summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 20px;
    color: var(--muted);
    font-size: 18px;
    font-weight: 400;
    transform: translateY(-50%);
}

.host-help[open] > summary::after { content: "−"; }

.host-help-body {
    padding: 20px;
    border-top: 1px solid var(--border);
}

.host-help-body .guide-heading-row { margin-bottom: 16px; }
.host-help-body .guide-heading-row h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: .04em;
}

.host-help-note {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.75;
    text-align: center;
}

.host-help-note a {
    color: inherit;
    text-decoration: underline;
}

.operation-panel {
    scroll-margin-top: 18px;
    border-color: #cfd7e2;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.lottery-card {
    aspect-ratio: 1 / 1;
    min-height: 0;
    border: 1px solid transparent;
    border-radius: 1px;
    background: var(--card-default);
    color: #55524d;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px;
    text-align: center;
}

button.lottery-card:hover:not(:disabled) { border-color: #b9b5ad; transform: translateY(-1px); }
button.lottery-card:disabled { opacity: 1; }
.lottery-card.taken { background: #d8d5ce; color: #66625c; }
.lottery-card.selected { border-color: #55524d; background: #55524d; color: #fff; transform: translateY(-2px); }
.lottery-card .number {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: .08em;
}
.lottery-card .owner {
    margin-top: 6px;
    color: #77736c;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    overflow-wrap: anywhere;
}
.selection-result-section {
    margin-top: 24px;
    border: 1px solid var(--border);
    background: #faf9f6;
}
.selection-result-section summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .08em;
    cursor: pointer;
    list-style: none;
}
.selection-result-section summary::-webkit-details-marker {
    display: none;
}
.selection-result-section summary::after {
    content: "＋";
    flex: 0 0 auto;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}
.selection-result-section[open] summary::after {
    content: "−";
}
.selection-result-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin: 0 20px 20px;
    padding: 0;
    list-style: none;
}
.selection-result-list li {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    min-height: 42px;
    border: 1px solid #dedbd4;
    background: #fff;
}
.selection-result-number {
    display: grid;
    align-self: stretch;
    place-items: center;
    border-right: 1px solid #dedbd4;
    color: #55524d;
    font-size: 16px;
    font-weight: 700;
}
.selection-result-name {
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.selection-result-name.unselected {
    color: var(--muted);
    font-weight: 400;
}
#guestCardArea .owner { display: none; }
#guestCardArea {
    display: grid;
    width: min(100%, 286px);
    margin-inline: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: start;
}
#guestCardArea .lottery-card {
    width: 100%;
}
#guestCardArea .number {
    color: #55524d;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
}
#guestCardArea .lottery-card.taken .number { color: #66625c; }
#guestCardArea .lottery-card.selected .number { color: #fff; }
.reload-hint {
    margin-top: 18px;
    text-align: center;
    opacity: .75;
}

#loadingPanel,
#joinPanel,
#playPanel,
#resultPanel {
    width: 100%;
    max-width: 360px;
    margin-right: auto;
    margin-left: auto;
}

#playPanel,
#playPanel .notice { text-align: center; }
#playPanel .status-line { justify-content: center; }
#playPanel .status-line h2 { width: 100%; }

.terms-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.6; }
.terms-check input { margin-top: 4px; }

.auth-privacy-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.65;
}
.auth-privacy-note a {
    color: inherit;
    text-decoration: underline;
}
.retention-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.65;
}

.host-reload-notice {
    margin: 14px 0 20px;
    padding: 10px 12px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    color: #445166;
    background: #f5f7fa;
    font-size: 12px;
    line-height: 1.7;
}

.result-panel {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.result-panel h2 {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .1em;
}
.result-name-label {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .08em;
}
.result-display-name {
    max-width: 100%;
    margin: 0 0 24px;
    color: var(--text);
    font-size: clamp(20px, 6vw, 28px);
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.result-number {
    margin: 0;
    color: var(--text);
    font-family: "Times New Roman", serif;
    font-size: 84px;
    font-weight: 200;
    line-height: 1;
}

.slot-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 28px;
    background: var(--bg);
}

.slot-overlay .slot-label { color: var(--muted); letter-spacing: .24em; font-size: 12px; }
.slot-overlay .slot-number {
    color: var(--text);
    font-family: "Times New Roman", "Yu Mincho", serif;
    font-size: min(32vw, 190px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: .08em;
}

.footer { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.8; padding: 24px 0; }
.footer a { display: inline-block; white-space: nowrap; }

.admin-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.room-list { max-height: 70vh; overflow: auto; }
.room-item { display: block; width: 100%; text-align: left; margin-bottom: 8px; background: #fff; color: var(--text); border-color: var(--border); }
.room-item.active { border-color: var(--accent); background: var(--accent-soft); }
.data-list { display: grid; gap: 6px; font-size: 13px; }

.cookie-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 10000;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    max-width: 900px;
    margin: auto;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0,0,0,.16);
    font-size: 13px;
    line-height: 1.6;
}

.cookie-banner-copy strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 15px;
}

.cookie-banner-copy p { margin: 0; }

.cookie-banner-actions,
.privacy-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cookie-banner-actions { justify-content: flex-end; }

.privacy-action {
    min-width: 92px;
    padding: 9px 13px;
    white-space: nowrap;
}

.privacy-action-secondary {
    border-color: var(--border);
    background: #fff;
    color: var(--accent);
}

.privacy-policy-links {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.privacy-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(31, 35, 40, .52);
}

.privacy-dialog {
    width: min(560px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 20px 56px rgba(0, 0, 0, .24);
}

.privacy-dialog-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.privacy-dialog-heading h2 {
    margin: 0;
    font-family: "Times New Roman", "Yu Mincho", serif;
    font-size: 21px;
    font-weight: 400;
    letter-spacing: .06em;
}

.privacy-close-button {
    flex: none;
    padding: 6px 9px;
    border-color: var(--border);
    background: #fff;
    color: var(--muted);
    font-size: 11px;
}

.privacy-dialog-intro {
    margin: 14px 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.privacy-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 2px;
    border-top: 1px solid var(--border);
}

.privacy-choice-copy strong,
.privacy-choice-copy small { display: block; }

.privacy-choice-copy strong { margin-bottom: 4px; }

.privacy-choice-copy small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.privacy-choice input {
    flex: none;
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

.privacy-dialog-actions {
    justify-content: flex-end;
    margin-top: 18px;
}

.privacy-modal-open { overflow: hidden; }

.guest-privacy-notice {
    margin: 12px 0 10;
    padding: 10px 12px;
    border-left: 3px solid var(--border);
    background: #fafafa;
    list-style: none;
}

.guest-privacy-notice li {
    position: relative;
    padding-left: 1em;
}

.guest-privacy-notice li::before {
    position: absolute;
    left: 0;
    content: "・";
}

.guest-privacy-notice li + li {
    margin-top: 4px;
}

.cookie-settings-button {
    position: fixed;
    right: 10px;
    bottom: 10px;
    z-index: 9998;
    padding: 6px 9px;
    border-color: var(--border);
    background: #fff;
    color: var(--muted);
    font-size: 10px;
}

@media (max-width: 680px) {
    .app-shell { width: min(100% - 18px, 920px); padding-top: 18px; }
    .panel { padding: 16px; }
    .live-room-header {
        grid-template-columns: 1fr;
        margin: -16px -16px 16px;
        padding: 20px 16px 18px;
    }
    .live-room-heading { grid-column: 1; }
    .live-room-header .status-badge {
        grid-column: 1;
        grid-row: 2;
        justify-self: center;
    }
    .live-room-header h2 { font-size: clamp(30px, 10vw, 40px); }
    .form-row { grid-template-columns: 1fr; gap: 5px; }
    .share-grid { grid-template-columns: 1fr; text-align: center; }
    .operation-steps,
    .guide-images { grid-template-columns: 1fr; }
    .service-guide { padding: 20px 16px; }
    .guide-intro { padding-top: 2px; }
    .guide-intro::after { right: 10%; left: 10%; }
    .guide-heading-row { align-items: flex-start; }
    .host-update { padding: 14px 14px 12px 16px; }
    .host-update-list { height: 132px; }
    .host-update-item { grid-template-columns: 1fr; gap: 2px; }
    .service-flow,
    .feature-grid { grid-template-columns: 1fr; }
    .notice-list li { grid-template-columns: 1fr; gap: 3px; }
    .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
    .lottery-card { min-height: 0; padding: 5px; }
    .lottery-card .number { font-size: 15px; }
    .selection-result-section { margin-top: 18px; }
    .selection-result-section summary { padding: 14px; }
    .selection-result-list { grid-template-columns: 1fr; margin: 0 14px 14px; }
    #guestCardArea .number { font-size: 10px; }
    .admin-layout { grid-template-columns: 1fr; }
    .room-list { max-height: 260px; }
    .cookie-banner {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }
    .cookie-banner-actions { justify-content: stretch; }
    .cookie-banner-actions .privacy-action { flex: 1; }
    .privacy-overlay { padding: 10px; }
    .privacy-dialog {
        max-height: calc(100vh - 20px);
        padding: 18px 16px;
    }
    .privacy-dialog-actions .privacy-action { flex: 1; }
    .qr-modal { padding: 10px; }
    .qr-dialog {
        max-height: calc(100vh - 20px);
        padding: 18px 16px;
    }
    .qr-dialog-heading h2 { font-size: 20px; }
    .cookie-settings-button {
        right: 8px;
        bottom: 8px;
    }
}
