:root {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --text: #111111;
  --muted: #666666;
  --border: #dddddd;
  --nav-height: 78px;
}

* {
  box-sizing: border-box;
}

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

button {
  font: inherit;
}

.app-shell {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 72px;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  display: flex;
  align-items: end;
  background: #d9e41f;
  color: #ffffff;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.logo {
  position: absolute;
  width: 80%;
  left:50%;
  top:-3px;
  transform: translate(-50%, 0);
}

.subtitle {
  position: absolute;
  width:100%;
  text-align: center;
  margin-top: 2px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  left:50%;
  top:30px;
  transform: translate(-50%, 0);
}

.content {
  flex: 1;
  padding: 22px 18px calc(var(--nav-height) + 30px + env(safe-area-inset-bottom));
}

.screen {
  display: none;
  min-height: calc(100svh - 180px);
}

.screen.active {
  display: block;
}

.screen h1 {
  margin: 0 0 12px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.screen p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.card-screen {
  display: none;
}

.card-screen.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.loyalty-card {
  width: 100%;
  max-width: 420px;
  margin: 18px auto 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
}

.loyalty-card__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  font-weight: 800;
}

.loyalty-card__top small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.barcode {
  width: 100%;
  height: 112px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      90deg,
      #111111 0 2px,
      transparent 2px 5px,
      #111111 5px 8px,
      transparent 8px 12px,
      #111111 12px 13px,
      transparent 13px 18px,
      #111111 18px 23px,
      transparent 23px 29px
    ),
    #ffffff;
  border: 12px solid #ffffff;
  outline: 1px solid #eeeeee;
}

.barcode-number {
  margin-top: 12px;
  text-align: center;
  font-size: 18px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.hint {
  margin-top: 18px !important;
  text-align: center;
  font-size: 13px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.nav-btn {
  min-width: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
}

.nav-btn.active {
  color: var(--text);
  background: #eeeeee;
}

.nav-btn--main {
  color: #ffffff;
  background: #111111;
  transform: translateY(-10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.nav-btn--main.active {
  color: #ffffff;
  background: #111111;
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
}

@media (min-width: 720px) {
  .app-shell {
    max-width: 480px;
    margin: 0 auto;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--bg);
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    width: 480px;
    transform: translateX(-50%);
  }
}


.settings-card {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
}

.settings-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.settings-card p {
  margin: 0;
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  background: #111111;
  color: #ffffff;
  font-weight: 800;
}

.primary-btn:disabled {
  opacity: 0.55;
}

.status-text {
  margin-top: 12px !important;
  font-size: 13px;
}

.secondary-btn {
  width: 100%;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  background: #ffffff;
  color: #111111;
  font-weight: 800;
}

.secondary-btn:disabled {
  opacity: 0.55;
}
