:root {
  --blue: #1e5bd8;
  --blue-dark: #0d1b3d;
  --yellow: #ffd43b;
  --background: #f7f8fa;
  --card: #ffffff;
  --text: #0d1b3d;
  --muted: #6b7280;
  --line: #e5e7eb;
  --green: #16805c;
  --red: #be3d4a;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #93b4ff; outline-offset: 2px; }

.app-shell { width: min(100%, 620px); min-height: 100vh; margin: 0 auto; padding: 16px; background: var(--background); }
.screen { display: none; min-height: calc(100vh - 32px); }
.screen.active { display: block; }

#language-screen { position: relative; align-content: center; min-height: calc(100vh - 32px); padding: 32px 8px; text-align: center; background: linear-gradient(160deg, var(--blue-dark), var(--blue)); color: #fff; }
#language-screen::before { position: absolute; inset: 0; background: repeating-linear-gradient(135deg, transparent 0 42px, #ffffff10 43px 44px); content: ""; pointer-events: none; }
#language-screen > * { position: relative; z-index: 1; }
.hero-lines { position: absolute; top: 25%; left: -8%; width: 116%; height: 34%; border-top: 1px solid #ffffff45; border-bottom: 1px solid #ffffff45; transform: skewY(-6deg); }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .75rem; font-weight: 800; letter-spacing: .12em; }
#language-screen .eyebrow { color: #d9e7ff; }
.brand-mark { margin: 0 auto 16px; color: var(--yellow); font-size: 48px; text-shadow: 0 0 26px #f6d84a55; }
#language-description { margin: 0 0 12px; color: #fff; font-size: 1.05rem; font-weight: 700; }
.hero-note { color: #d9e7ff; font-size: .9rem; line-height: 1.8; }

.language-actions, .menu-actions { display: grid; gap: 14px; margin-top: 24px; }
.primary-button, .menu-card { width: 100%; min-height: 48px; border: 1px solid var(--blue); border-radius: 12px; background: var(--blue); color: #fff; padding: 12px 16px; transition: background .15s ease, box-shadow .15s ease, transform .15s ease; }
.primary-button:hover, .menu-card:hover { background: #174caf; box-shadow: 0 4px 12px #0d1b3d1c; }
.primary-button:active, .menu-card:active { transform: translateY(1px); }
#language-screen .primary-button { border-color: var(--yellow); background: var(--yellow); color: var(--blue-dark); font-weight: 800; }
#language-screen .primary-button + .primary-button { border-color: #ffffff90; background: #ffffff14; color: #fff; }

.screen-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.screen-header.compact { margin-bottom: 14px; }
.screen-header h1, .screen-header h2 { margin: 0; color: var(--blue-dark); font-size: 1.25rem; line-height: 1.3; }
.language-switch, .back-button, .secondary-link { min-height: 44px; border: 0; background: transparent; color: var(--blue); padding: 8px 0; }
.back-button { font-weight: 700; }
#menu-screen .screen-header { position: relative; overflow: hidden; margin: -16px -16px 16px; border-bottom: 0; border-radius: 0 0 24px 24px; padding: 24px 16px 20px; background: linear-gradient(135deg, #1647b8 0%, #1e5bd8 52%, #2da8ef 100%); box-shadow: 0 8px 20px #1e5bd833; }
#menu-screen .screen-header::after { position: absolute; right: -36px; bottom: -54px; width: 150px; height: 120px; border: 18px solid #ffd43b88; border-radius: 50%; content: ""; transform: rotate(-18deg); pointer-events: none; }
#menu-screen .screen-header h1, #menu-screen .screen-header .eyebrow { color: #fff; }
#menu-screen .screen-header .language-switch { color: #fff; }
.menu-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.menu-card { display: grid; align-content: start; gap: 9px; min-height: 176px; border-color: #d8e2f2; border-radius: 18px; background: var(--card); color: var(--blue-dark); padding: 10px; text-align: left; box-shadow: 0 5px 14px #0d1b3d14; }
.menu-card:hover { border-color: var(--blue); background: #fff; }
.menu-image { width: 100%; height: 92px; border-radius: 12px; object-fit: cover; }
.menu-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-top: -26px; margin-left: 6px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); color: #fff; font-size: 1.1rem; }
.menu-card strong, .menu-card small { display: block; }
.menu-card strong { font-size: .95rem; }
.menu-card small { margin-top: 4px; color: var(--muted); font-size: .85rem; }
.secondary-link { justify-self: center; margin-top: 4px; }
.staff-links { display: flex; justify-content: flex-end; margin-top: 20px; }
.admin-entry { min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: .75rem; }
.screen-hint, .muted { color: var(--muted); font-size: .9rem; }

.announcement-box { margin-top: 16px; border: 1px solid #dbe7f8; border-top: 4px solid var(--blue); border-radius: 18px; background: #fff; color: var(--blue-dark); overflow: hidden; box-shadow: 0 6px 16px #0d1b3d12; }
.announcement-heading { display: flex; align-items: center; gap: 8px; padding: 13px 14px 9px; color: var(--blue-dark); font-size: .85rem; }
.announcement-heading > span:last-child { color: var(--blue); font-size: .7rem; font-weight: 800; letter-spacing: .08em; }
.announcement-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px #fff4bf; }
.announcement-window { overflow: hidden; padding: 8px 0 10px; }
.announcement-track { display: flex; width: 100%; min-width: 100%; transition: transform .4s ease; }
.announcement-item { display: grid; grid-template-columns: auto auto; flex: 0 0 100%; gap: 4px 10px; margin: 0; padding: 4px 14px 8px; }
.announcement-item strong { grid-column: 1 / -1; color: var(--blue-dark); font-size: .95rem; line-height: 1.55; }
.announcement-item time { color: var(--blue); font-size: .76rem; font-weight: 800; }
.announcement-type { width: fit-content; border-radius: 999px; background: #eef4ff; color: var(--blue); padding: 2px 8px; font-size: .72rem; font-weight: 800; }
.announcement-controls { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 12px 13px; color: var(--muted); font-size: .75rem; }
.announcement-controls button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; box-shadow: 0 3px 8px #1e5bd833; }

.filter-bar { display: grid; gap: 10px; margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.filter-bar label { display: grid; gap: 5px; color: var(--blue-dark); font-size: .85rem; font-weight: 700; }
.filter-bar select, .filter-bar input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); padding: 10px 12px; font-weight: 400; }
.event-list { display: grid; gap: 12px; }
.event-card { border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 12px; background: var(--card); color: var(--text); padding: 16px; box-shadow: 0 2px 8px #0d1b3d0c; text-align: left; }
.event-card h3 { margin: 0 0 7px; color: var(--blue-dark); font-size: 1rem; line-height: 1.4; }
.event-card p { margin: 0 0 7px; color: var(--muted); font-size: .9rem; }
.event-card details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; color: var(--text); }
.event-card .time, .event-card .location { color: var(--muted); }
.event-class { color: var(--blue) !important; font-weight: 700; }
.status { font-weight: 800; }
.status-open { color: var(--green) !important; }
.status-notStarted { color: var(--blue) !important; }
.status-paused { color: #a87900 !important; }
.status-cancelled { color: var(--red) !important; }
.status-unupdated { color: var(--muted) !important; }
.filter-bar + .event-list:empty::after { content: "条件に一致する情報がありません。"; padding: 24px 0; color: var(--muted); text-align: center; }

.map-canvas { position: relative; min-height: 520px; overflow: hidden; border: 1px solid #c6dce9; border-radius: 16px; background: linear-gradient(135deg, #edf7fc, #cfe7f2); box-shadow: inset 0 0 0 1px #b8d3e255; transform-origin: center; transition: transform .2s ease; }
.map-canvas::after { position: absolute; inset: 8% 10%; border: 1px dashed #6ea7c055; border-radius: 45% 55% 50% 40%; content: ""; pointer-events: none; }
.map-label { position: absolute; z-index: 1; color: #24506e; font-weight: 800; }
.building-a { top: 26%; left: 17%; }
.gym { right: 16%; bottom: 24%; }
.map-marker { position: absolute; z-index: 2; width: 52px; height: 52px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); color: var(--blue-dark); font-weight: 800; box-shadow: 0 4px 12px #0d1b3d40; }
.map-marker.selected { background: var(--yellow); }
.marker-d { top: 20%; left: 24%; }
.marker-e { top: 44%; left: 54%; }
.marker-p { bottom: 20%; left: 28%; }
.marker-n { right: 18%; bottom: 34%; }
.map-toolbar { position: absolute; z-index: 3; right: 28px; bottom: 28px; display: grid; gap: 8px; }
.map-toolbar button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--blue-dark); color: #fff; font-size: 1.5rem; }
.map-panel { position: sticky; z-index: 4; bottom: 12px; margin: -110px 12px 12px; padding: 16px; border-radius: 12px; background: var(--blue-dark); color: #fff; box-shadow: 0 8px 24px #0d1b3d44; }
.panel-link { border: 0; background: transparent; color: var(--yellow); padding: 0; font-weight: 800; }

.update-card, .admin-editor { display: grid; gap: 10px; border: 1px solid var(--line); border-top: 4px solid var(--yellow); border-radius: 12px; background: var(--card); padding: 18px; box-shadow: 0 2px 8px #0d1b3d0c; }
.update-card label, .admin-editor label { margin-top: 6px; color: var(--blue-dark); font-weight: 700; }
.update-card select, .update-card input, .update-card textarea, .admin-editor input, .admin-editor select, .admin-editor textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); padding: 12px; }
.update-card textarea, .admin-editor textarea { resize: vertical; }
.current-status { padding: 12px; border-radius: 10px; background: #eef4ff; color: var(--blue-dark); }
.success-message { min-height: 1.4em; color: var(--green); }

.admin-login-card { text-align: center; }
.admin-mark { margin: 8px 0; color: var(--yellow); font-size: 2.5rem; }
.admin-login-card h3 { margin: 0; color: var(--blue-dark); }
.admin-choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
.admin-choice-grid button { min-height: 44px; border: 1px solid var(--blue); border-radius: 10px; background: #fff; color: var(--blue); padding: 10px 8px; font-weight: 700; }
.admin-choice-grid button.selected { background: var(--blue); color: #fff; box-shadow: 0 0 0 3px #ffd43b88; }
.admin-auth-panel { display: grid; gap: 8px; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; text-align: left; }
.admin-auth-panel input, .admin-auth-panel select, .admin-login-card input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 11px; }
.admin-login-card label { display: block; margin-top: 8px; color: var(--blue-dark); font-weight: 700; text-align: left; }
.error-message { min-height: 1.4em; margin: 0; color: var(--red); }
.admin-login-note { font-size: .75rem; }
.admin-sections { display: none !important; }
#admin-editor { display: none !important; }
.quick-update-card[hidden], .admin-editor[hidden], .dashboard-summary[hidden], .admin-sections[hidden] { display: none !important; }
.dashboard-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.dashboard-summary div { display: grid; gap: 4px; padding: 12px 6px; border-radius: 10px; background: var(--blue-dark); color: #fff; text-align: center; }
.dashboard-summary strong { color: var(--yellow); font-size: 1.45rem; }
.dashboard-summary span { font-size: .72rem; }
.admin-section { border: 1px solid var(--line); border-left: 4px solid var(--blue); padding: 14px; background: #fff; box-shadow: 0 2px 8px #0d1b3d0c; }
.admin-section h3 { margin: 0 0 6px; color: var(--blue-dark); }
.admin-section p { margin: 0 0 12px; color: var(--muted); font-size: .85rem; }
.secondary-button { min-height: 44px; border: 1px solid var(--blue); border-radius: 10px; background: #fff; color: var(--blue); padding: 10px 12px; font-weight: 700; }
.danger-button { min-height: 44px; border: 1px solid var(--red); border-radius: 10px; background: #fff; color: var(--red); padding: 10px 14px; font-weight: 700; }
.announcement-admin-list { display: grid; gap: 12px; }
.announcement-admin-row { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.announcement-admin-row div { display: grid; gap: 4px; }
.announcement-admin-row time { color: var(--muted); font-size: .9rem; }
.announcement-admin-row p { color: var(--blue-dark); }
.quick-update-card { display: grid; gap: 10px; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 12px; background: #fff; }
.quick-update-card h3 { margin: 0; color: var(--blue-dark); }
.quick-update-card select { min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fff; color: var(--text); }
.quick-label { margin: 6px 0 0; color: var(--blue-dark); font-size: .85rem; font-weight: 700; }
.quick-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-buttons button { min-height: 44px; border: 1px solid var(--blue); border-radius: 10px; background: #fff; color: var(--blue); padding: 9px 6px; font-size: .85rem; }
.quick-buttons button.selected { background: var(--blue); color: #fff; }
.qr-card { border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 12px; padding: 18px; background: #fff; text-align: center; box-shadow: 0 2px 8px #0d1b3d0c; }
.qr-card h3 { margin: 0 0 14px; color: var(--blue-dark); }
.qr-card p { margin: 14px 0 0; color: var(--muted); font-size: .85rem; }
.qr-code { display: grid; place-items: center; min-height: 180px; padding: 8px; }
.qr-code img, .qr-code canvas { max-width: 100%; height: auto; }

@media (min-width: 700px) {
  .app-shell { padding: 24px; }
  .screen { min-height: calc(100vh - 48px); }
  #language-screen { min-height: calc(100vh - 48px); }
  #menu-screen .screen-header { margin: -24px -24px 16px; padding: 28px 24px 22px; }
  .event-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
