:root {
  --indigo: #7a4a2f;
  --indigo-dark: #5c3821;
  --gold: #c47a3d;
  --gold-light: #dd9c5e;
  --cream: #fbf6ee;
  --cream-alt: #f3e9d9;
  --text: #3f362c;
  --busy: #b3432b;
  --free: #6f8f5e;
  --serif: "Shippori Mincho", serif;
  --sans: "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  background: #201811;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(32, 24, 17, 0.82) 0%, rgba(32, 24, 17, 0.9) 55%, rgba(20, 14, 9, 0.96) 100%),
    url('/photos/hero-view.jpg') center / cover no-repeat;
}

.fatal-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 8vw;
  font-family: var(--serif);
  font-size: 1.4rem;
  text-align: center;
}

.overline {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin: 0 0 0.4em;
  font-weight: 500;
}

header.app-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 12px;
  padding: max(20px, env(safe-area-inset-top)) 20px 14px;
}
.app-header__brand {
  min-width: 0;
}
header.app-header h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-pill {
  font-family: var(--serif);
  font-size: 0.9rem;
  padding: 0.35em 0.9em;
  border: 1px solid rgba(221, 156, 94, 0.55);
  border-radius: 999px;
  color: var(--gold-light);
  background: rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  flex-shrink: 0;
}

main {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.view {
  display: none;
  padding: 4px 20px 32px;
}
.view.active {
  display: block;
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: var(--tile-photo) center / cover no-repeat, #3a2b1d;
  border: 1px solid rgba(251, 246, 238, 0.14);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.photo-tile:active {
  transform: scale(0.96);
}
.photo-tile__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 14, 9, 0.05) 40%, rgba(20, 14, 9, 0.88) 100%);
}
.photo-tile__scrim--solid {
  background: linear-gradient(160deg, var(--indigo) 0%, var(--indigo-dark) 100%);
}
.photo-tile__label {
  position: absolute;
  left: 1em;
  right: 1em;
  bottom: 0.9em;
}
.photo-tile__label--center {
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.photo-tile__ja {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0;
  color: var(--cream);
}
.call-button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 12px;
  padding: 18px 20px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  text-align: left;
}
.call-button:active {
  transform: scale(0.98);
}
.call-button__icon {
  font-size: 2rem;
  line-height: 1;
}
.call-button__text {
  display: flex;
  flex-direction: column;
}
.call-button .overline {
  color: rgba(32, 24, 17, 0.7);
  margin-bottom: 0.2em;
}
.call-button__ja {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: #2b1d10;
}

.back-button {
  font-family: var(--sans);
  background: rgba(251, 246, 238, 0.08);
  border: 1px solid rgba(251, 246, 238, 0.25);
  color: var(--cream);
  border-radius: 999px;
  padding: 0.6em 1.3em;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 14px 0 10px;
}
.back-button:active {
  background: rgba(251, 246, 238, 0.16);
}

.panel-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0 0 16px;
  letter-spacing: 0.02em;
}

.glass-panel {
  background: rgba(251, 246, 238, 0.06);
  border: 1px solid rgba(251, 246, 238, 0.12);
  border-radius: 16px;
  padding: 18px 16px;
  backdrop-filter: blur(6px);
}

.fact-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 16px;
  font-size: 0.95rem;
  margin: 0;
}
.fact-list dt { color: var(--gold-light); font-family: var(--serif); }
.fact-list dd { margin: 0; }

.fact-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fact-cards li {
  background: rgba(251, 246, 238, 0.06);
  border: 1px solid rgba(251, 246, 238, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fact-cards__name { font-family: var(--serif); font-weight: 600; }

.bath-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.bath-list__item {
  display: flex;
  justify-content: space-between;
  background: rgba(251, 246, 238, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
}
.bath-list__item.is-busy { border-left: 4px solid var(--busy); }
.bath-list__item.is-free { border-left: 4px solid var(--free); }
.bath-list__item.is-unknown { border-left: 4px solid rgba(251, 246, 238, 0.3); }

.notice { color: var(--gold-light); }

/* ---------- FAQ ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: rgba(251, 246, 238, 0.06);
  border: 1px solid rgba(251, 246, 238, 0.12);
  border-radius: 14px;
  overflow: hidden;
}
.faq-item__question {
  width: 100%;
  text-align: left;
  font-family: var(--serif);
  font-size: 1rem;
  background: none;
  border: none;
  color: var(--cream);
  padding: 14px 16px;
  cursor: pointer;
}
.faq-item__question:active {
  background: rgba(221, 156, 94, 0.15);
}
.faq-item__answer {
  padding: 0 16px 16px;
  color: var(--cream-alt);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ---------- 通話画面(Jitsiのiframeは画面外に隠し、これだけを見せる) ---------- */
.view-call {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.call-body {
  background: #201811;
}
.call-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}
.call-screen__room {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--gold-light);
  margin: 0;
}
.call-screen__status {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 0;
}
.call-screen__icon-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.call-screen__icon {
  font-size: 3.2rem;
  z-index: 1;
}
.call-screen__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(221, 156, 94, 0.25);
  animation: call-pulse 1.6s ease-out infinite;
}
@keyframes call-pulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1); opacity: 0; }
}
.call-screen__timer {
  font-variant-numeric: tabular-nums;
  font-size: 1.6rem;
  color: var(--cream-alt);
  margin: 0;
}
.call-screen__actions {
  display: flex;
  gap: 32px;
  margin-top: 14px;
}
.call-action {
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--cream);
}
.call-action__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.call-action__label {
  font-size: 0.8rem;
  color: var(--cream-alt);
}
.call-action--mute .call-action__icon {
  background: rgba(251, 246, 238, 0.14);
  color: var(--cream);
}
.call-action--mute.is-muted .call-action__icon {
  background: var(--gold);
  color: #2b1d10;
}
.call-action--hangup .call-action__icon {
  background: var(--busy);
  color: #fff;
}
.call-action__icon--phone {
  transform: rotate(135deg);
}
.call-action:active .call-action__icon {
  transform: scale(0.94);
}
.call-action--hangup:active .call-action__icon {
  transform: scale(0.94) rotate(135deg);
}
.call-hidden-container {
  position: fixed;
  /* 1x1pxまで縮めるとJitsi側の参加者検知が不安定になったため、実寸大のまま画面外へ追い出す方式にしている */
  width: 400px;
  height: 300px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
}

@media (min-width: 640px) {
  .view { max-width: 560px; margin: 0 auto; }
  header.app-header { max-width: 560px; margin: 0 auto; width: 100%; }
}
