:root {
  color-scheme: light;
  --bg: #f7f3eb;
  --bg-deep: #eadfcd;
  --surface: #fffdf8;
  --surface-2: #fff4e4;
  --ink: #1b262d;
  --muted: #59656f;
  --accent: #d97706;
  --accent-2: #0f766e;
  --accent-3: #cc4a33;
  --danger: #b42318;
  --outline: rgba(27, 38, 45, 0.14);
  --shadow: 0 18px 38px rgba(27, 38, 45, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

body.guest-locked .top-bar,
body.guest-locked .hero {
  display: none;
}

body.guest-locked .frame {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px 40px;
}

body.guest-locked #guestSection {
  width: min(520px, 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -20vmax;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(circle at 15% 15%, rgba(15, 118, 110, 0.16), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(217, 119, 6, 0.18), transparent 45%),
    radial-gradient(circle at 60% 85%, rgba(204, 74, 51, 0.12), transparent 40%),
    linear-gradient(120deg, rgba(234, 223, 205, 0.2), rgba(247, 243, 235, 0.9));
}

body::after {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(27, 38, 45, 0.03) 0,
    rgba(27, 38, 45, 0.03) 1px,
    transparent 1px,
    transparent 12px
  );
  opacity: 0.5;
}

main {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.frame {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 72px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 0;
}

.brand {
  font-family: "Shippori Mincho", serif;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 0 2px var(--surface);
}

.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav a {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid transparent;
  transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.nav a.active {
  border-color: var(--accent-2);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.nav a:hover {
  transform: translateY(-1px);
  border-color: var(--accent-2);
  background: #fff;
}

.session-chip {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid rgba(27, 38, 45, 0.1);
}

.account-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  appearance: none;
  border: 1px solid rgba(27, 38, 45, 0.2);
  background: #fff;
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-lines {
  width: 16px;
  height: 2px;
  background: var(--ink);
  display: block;
  position: relative;
}

.icon-lines::before,
.icon-lines::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--ink);
}

.icon-lines::before {
  top: -5px;
}

.icon-lines::after {
  top: 5px;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 38, 45, 0.18);
  z-index: 10;
}

.menu-popover {
  position: fixed;
  top: 72px;
  right: 24px;
  width: min(360px, calc(100vw - 48px));
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
  z-index: 20;
  display: grid;
  gap: 12px;
}

.menu-header h2 {
  margin: 0 0 6px;
  font-family: "Shippori Mincho", serif;
  font-size: 1.3rem;
}

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

.hero {
  margin-top: 24px;
  display: grid;
  gap: 18px;
  animation: float-in 0.7s ease both;
}

.hero h1 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: clamp(2.1rem, 3.4vw, 3.2rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 720px;
}

.card {
  margin-top: 20px;
  padding: 24px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--outline);
  box-shadow: var(--shadow);
  animation: rise 0.6s ease both;
}

.card h2 {
  margin: 0 0 12px;
  font-family: "Shippori Mincho", serif;
  font-size: 1.5rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.card.muted {
  background: rgba(255, 253, 248, 0.75);
  border-style: dashed;
  box-shadow: none;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.auth-card {
  display: grid;
  gap: 16px;
}

.auth-toggle {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid rgba(27, 38, 45, 0.12);
  width: fit-content;
}

.auth-toggle .tab {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.auth-toggle .tab.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(27, 38, 45, 0.12);
}

.auth-panel {
  display: grid;
  gap: 12px;
}

.menu-grid {
  margin-top: 16px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.menu-card {
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid rgba(27, 38, 45, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.menu-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.menu-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.menu-card button,
.menu-card .button {
  align-self: flex-start;
}

.banner {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(180, 35, 24, 0.3);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
  font-weight: 600;
}

.banner.hidden {
  display: none;
}

.list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-2);
}

.pill.warning {
  background: rgba(217, 119, 6, 0.12);
  color: var(--accent);
}

.pill.danger {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

button,
.button {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.25);
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(27, 38, 45, 0.2);
  box-shadow: none;
}

button.ghost,
.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px dashed rgba(27, 38, 45, 0.2);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(120deg, #d14343, #b42318);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

form {
  display: grid;
  gap: 12px;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"] {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(27, 38, 45, 0.2);
  background: #fff;
  font-size: 0.95rem;
}

input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.3);
  border-color: rgba(15, 118, 110, 0.6);
}

.helper {
  font-size: 0.85rem;
  color: var(--muted);
}

.inline {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.status {
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.status.success {
  color: var(--accent-2);
  font-weight: 600;
}

.status.danger {
  color: var(--danger);
  font-weight: 600;
}

.details {
  padding: 12px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.06);
  border: 1px solid rgba(15, 118, 110, 0.18);
}

.details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-2);
}

.hidden {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 840px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .frame {
    padding: 24px 20px 56px;
  }

  .card {
    padding: 18px;
  }

  .menu-popover {
    top: 96px;
    left: 16px;
    right: 16px;
    width: auto;
  }
}

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