*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --accent: #e85d04;
  --accent-hover: #d45103;
  --accent-light: #fff4ec;
  --border: #e5e7eb;
  --success: #16a34a;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --radius: 16px;
  --page-x: max(16px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px));
  --page-bottom: calc(220px + env(safe-area-inset-bottom, 0px));
}

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

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: clip;
}

.welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--page-x);
  background: var(--bg);
}

.welcome[hidden] {
  display: none;
}

.welcome__inner {
  width: min(560px, 100%);
  text-align: center;
}

.welcome__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.welcome__subtitle {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

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

.welcome-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.welcome-choice:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.welcome-choice__icon {
  font-size: 3rem;
  line-height: 1;
}

.welcome-choice__label {
  font-size: 1.1rem;
  font-weight: 700;
}

.welcome-choice__sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .welcome__title {
    font-size: 2rem;
  }

  .welcome__choices {
    gap: 24px;
    margin-top: 48px;
  }

  .welcome-choice {
    padding: 40px 24px;
  }

  .welcome-choice__icon {
    font-size: 3.5rem;
  }

  .welcome-choice__label {
    font-size: 1.25rem;
  }

  .welcome-choice__sub {
    font-size: 0.85rem;
  }
}

.app[hidden] {
  display: none;
}

.page {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 24px var(--page-x) var(--page-bottom);
}

.header {
  position: relative;
  text-align: center;
  margin-bottom: 24px;
}

.header__home {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.header__home-icon {
  display: block;
}

.header__home:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.header__badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 999px;
}

.header__title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__desc {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.header__desc-sub {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.label-ko {
  display: block;
}

.label-en {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.step-back {
  margin-top: 24px;
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.step-back:hover {
  color: var(--accent);
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

@media (min-width: 640px) {
  .menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

.menu-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

@media (min-width: 640px) {
  .menu-card {
    padding: 20px 16px;
    gap: 12px;
  }
}

.menu-card--active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.menu-card__image {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

.menu-card__name {
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  min-height: 2.8em;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .menu-card__name {
    font-size: 1.05rem;
  }
}

.menu-card__price {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  text-align: center;
  width: 100%;
}

.qty-control {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: auto;
  padding-top: 8px;
}

.qty-control__slot {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-control__btn {
  width: 38px;
  height: 38px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .qty-control__btn {
    width: 44px;
    height: 44px;
  }
}

.qty-control__btn:active:not(:disabled) {
  transform: scale(0.92);
}

.qty-control__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.qty-control__btn--plus {
  background: var(--accent);
  color: #fff;
}

.qty-control__btn--plus:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.qty-control__btn--minus:hover:not(:disabled) {
  background: var(--accent-light);
}

.qty-icon {
  display: block;
  position: relative;
}

.qty-icon--minus {
  width: 14px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.qty-icon--plus::before,
.qty-icon--plus::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.qty-icon--plus::before {
  width: 14px;
  height: 2px;
}

.qty-icon--plus::after {
  width: 2px;
  height: 14px;
}

.qty-control__count {
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  min-width: 1.5em;
}

@media (min-width: 640px) {
  .qty-control__count {
    font-size: 1.25rem;
  }
}

.site-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer__copy {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.site-footer__copy a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer__copy a:hover {
  color: var(--accent);
}

.order-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.order-bar__inner {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 12px var(--page-x);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-bar__summary.is-empty {
  display: none;
}

.order-bar__summary-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.order-bar__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  max-height: 80px;
  overflow-y: auto;
}

.order-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  background: var(--accent-light);
  padding: 5px 10px;
  border-radius: 999px;
}

.order-bar__item-qty {
  font-weight: 700;
  color: var(--accent);
}

.order-bar__checkout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .order-bar__inner {
    padding: 16px var(--page-x);
  }

  .order-bar__checkout {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
  }
}

.order-bar__total {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: baseline;
  gap: 8px;
  width: 100%;
}

.order-bar__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: left;
}

.order-bar__amount {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

@media (min-width: 640px) {
  .order-bar__total {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .order-bar__amount {
    font-size: 1.5rem;
    text-align: left;
  }
}

.order-bar__btn {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .order-bar__btn {
    width: auto;
    padding: 16px 32px;
  }
}

.order-bar__btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.order-bar__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--page-x);
}

.modal.hidden {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal__content {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: #dcfce7;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
}

.modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.modal__order-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.modal__order-label .label-en {
  font-size: 0.75rem;
}

.modal__order-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.modal__message {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 24px;
  white-space: pre-line;
}

.modal__btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.modal__btn-count {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 0.85rem;
  opacity: 0.9;
}

.idle-timer {
  position: absolute;
  top: 0;
  right: 0;
  pointer-events: none;
}

.idle-timer[hidden] {
  display: none;
}

.idle-timer__circle {
  position: relative;
  width: 40px;
  height: 40px;
}

.idle-timer__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.idle-timer__track {
  stroke: rgba(0, 0, 0, 0.08);
}

.idle-timer__progress {
  stroke: var(--text-muted);
  transition: stroke-dashoffset 1s linear;
}

.idle-timer__value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  transform: rotate(0deg);
}

.modal__btn:hover {
  background: var(--accent-hover);
}
