/* ==========================================================================
   Bulls & Cows (숫자야구): Core Application Styles & Layout
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/spoqa/spoqa-han-sans@latest/css/SpoqaHanSansNeo.css');

/* 현이고딕 (EF_혀니고딕) WebFont & Local Font Fallback */
@font-face {
  font-family: 'Hyeoni Gothic';
  src: local('EF_혀니고딕'),
       local('HyeoniGothic'),
       local('혀니고딕'),
       local('현이고딕'),
       url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2206-01@1.0/EF_hyunygothic.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'HyeoniGothic';
  src: local('EF_혀니고딕'),
       local('HyeoniGothic'),
       local('혀니고딕'),
       local('현이고딕'),
       url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2206-01@1.0/EF_hyunygothic.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-title: 'Hyeoni Gothic', 'HyeoniGothic', 'EF_혀니고딕', '혀니고딕', '현이고딕', 'Spoqa Han Sans Neo', sans-serif;
  --font-sans: 'Spoqa Han Sans Neo', 'Spoqa Han Sans', 'Spoka Han Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --bg-primary: #f3f8ff;
  --bg-surface: rgba(255, 255, 255, 0.9);
  --bg-card: #e8f2ff;
  --border-subtle: rgba(30, 91, 145, 0.18);
  --border-accent: #1677d2;
  --text-main: #142f4a;
  --text-muted: #5c7187;
  --color-bull: #f59e0b;
  --color-bull-glow: rgba(245, 158, 11, 0.4);
  --color-cow: #168bd2;
  --color-cow-glow: rgba(22, 139, 210, 0.24);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  word-break: keep-all;
  background-image: radial-gradient(ellipse at 50% 0%, #ffffff 0%, #f3f8ff 72%);
}

h1, h2, h3, h4, .brand-title, .menu-card-title, .curtain-title, .panel-header-title, .modal-header h2, .shop-category-title, .btn-submit-key, .btn-primary-action {
  font-family: var(--font-title);
  font-weight: 400 !important;
  font-synthesis: none;
  -webkit-font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

#vfx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* --- App Header & Wallet Bar --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10001;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-home {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.brand-home:focus-visible {
  outline: 2px solid var(--border-accent);
  outline-offset: 5px;
  border-radius: var(--radius-sm);
}

.brand-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 8px var(--color-bull-glow));
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #145da0 0%, #168bd2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.player-status-bar {
  display: flex;
  align-items: center;
  gap: 18px;
}

.online-room-banner {
  position: sticky;
  top: 60px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  min-height: 48px;
  padding: 8px 20px;
  background: rgba(232, 242, 255, 0.97);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
}

.online-room-code-label strong {
  margin-left: 6px;
  color: #145da0;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.online-room-copy {
  padding: 5px 10px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #145da0;
  font: inherit;
  cursor: pointer;
}

.online-room-copy:hover {
  background: #e3f1ff;
}

.player-level-label {
  color: #000;
  font-size: 0.8rem;
}

.wallet-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 119, 210, 0.07);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
}

.btn-icon-header {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.btn-icon-header:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* --- View Containers --- */
.view-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hidden {
  display: none !important;
}

/* --- Main Menu --- */
.menu-hero {
  text-align: center;
  padding: 48px 16px 36px;
}

.menu-hero h1 {
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.menu-hero p {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 580px;
  margin: 0 auto;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.menu-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.menu-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.menu-card-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.menu-card-title {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 8px;
}

.menu-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.menu-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--border-accent);
}

/* --- Card Slots (Input Display) --- */
.card-slots-container {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 28px 0;
  perspective: 1000px;
}

.card-slot {
  width: 68px;
  height: 94px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 2px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  position: relative;
  transition: all 0.25s ease;
  overflow: hidden;
}

.card-slot.card-filled {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.card-inner, .card-front, .card-back {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.card-slot.card-concealed {
  background: #dcecff;
  color: var(--text-muted);
}

.slot-placeholder {
  color: rgba(20, 47, 74, 0.28);
}

/* --- Interactive Keypad --- */
.keypad-container {
  max-width: 440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.keypad-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  min-height: 60px;
  padding: 12px 0;
  border-radius: 20px;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.keypad-btn:hover:not(:disabled) {
  background: rgba(22, 119, 210, 0.1);
  transform: translateY(-2px);
}

.keypad-btn:active:not(:disabled) {
  transform: translateY(1px);
  border-color: #1677d2;
  box-shadow: 0 0 0 3px rgba(22, 119, 210, 0.24), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.keypad-btn:focus-visible {
  outline: 2px solid #1677d2;
  outline-offset: 2px;
}

.keypad-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.key-frozen {
  background: rgba(56, 189, 248, 0.15) !important;
  border-color: #38bdf8 !important;
  color: #7dd3fc !important;
}

.btn-action-key {
  font-size: 1.1rem;
  font-family: var(--font-sans);
}

.btn-submit-key {
  background: linear-gradient(135deg, #2f9be8 0%, #1269bd 100%);
  color: #fff;
  font-weight: 800;
}

/* --- Deduction Scratchpad --- */
.deduction-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 24px;
}

.deduction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.deduction-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.deduction-legend {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
}

.deduction-pad {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.scratch-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.scratch-chip .chip-num {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.scratch-chip .chip-mark {
  font-size: 0.75rem;
  font-weight: 800;
  margin-top: 2px;
}

.scratch-possible {
  background: rgba(234, 179, 8, 0.2);
  border-color: #eab308;
  color: #fde047;
}

.scratch-eliminated {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
  text-decoration: line-through;
  opacity: 0.5;
}

.scratch-confirmed {
  background: rgba(34, 197, 94, 0.25);
  border-color: #22c55e;
  color: #4ade80;
}

/* --- Battle Split Arena --- */
.battle-arena-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  flex: 1;
}

@media (max-width: 860px) {
  .battle-arena-layout {
    grid-template-columns: 1fr;
  }
}

.battle-board-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.panel-header-title {
  font-size: 1.1rem;
  font-weight: 400;
}

.history-scroll-box {
  flex: 1;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 6px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.row-turn {
  color: var(--text-muted);
  font-size: 0.85rem;
  width: 32px;
}

.row-digits {
  display: flex;
  gap: 6px;
}

.history-digit {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.digit-bull-hit {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  box-shadow: 0 0 8px var(--color-bull-glow);
}

.digit-cow-hit {
  background: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
  box-shadow: 0 0 8px var(--color-cow-glow);
}

.row-feedback {
  display: flex;
  gap: 8px;
}

.badge-bull {
  background: var(--color-bull);
  color: #000;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}

.badge-cow {
  background: var(--color-cow);
  color: #000;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* --- Modifiers Panel --- */
.modifiers-bar {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modifier-text {
  font-size: 0.9rem;
  color: #145da0;
  font-weight: 600;
}

.btn-modifier {
  background: #0284c7;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-modifier:hover:not(:disabled) {
  background: #0369a1;
  transform: translateY(-1px);
}

/* --- Privacy Pass Curtain Screen --- */
.pass-curtain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(232, 242, 255, 0.96);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.curtain-content {
  max-width: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.curtain-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.curtain-title {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 10px;
}

.curtain-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 28px;
  line-height: 1.5;
}

.btn-primary-action {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4);
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.55);
}

/* --- Modal Windows --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(16, 48, 78, 0.32);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 820px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* --- Cosmetics Store Grid --- */
.shop-category-section {
  margin-bottom: 28px;
}

.shop-category-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.shop-card {
  background: rgba(22, 119, 210, 0.045);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.shop-card:hover {
  border-color: rgba(22, 119, 210, 0.32);
  transform: translateY(-2px);
}

.shop-card.item-equipped {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.shop-card-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.shop-card-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.shop-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 12px;
}

.shop-card-rarity {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.rarity-common .shop-card-rarity { color: #94a3b8; }
.rarity-rare .shop-card-rarity { color: #38bdf8; }
.rarity-epic .shop-card-rarity { color: #c084fc; }
.rarity-legendary .shop-card-rarity { color: #fbbf24; }

.btn-shop-action {
  width: 100%;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-buy {
  background: linear-gradient(135deg, #2f9be8 0%, #1269bd 100%);
  color: #fff;
}

.btn-equip {
  background: rgba(22, 119, 210, 0.09);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-equipped {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  cursor: default;
}

/* --- Achievements List in Profile --- */
.achievements-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.achievement-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(22, 119, 210, 0.045);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.achievement-card.achievement-done {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
}

.achievement-card.achievement-locked {
  opacity: 0.5;
}

.ach-icon {
  font-size: 2rem;
}

.ach-title {
  font-weight: 700;
  font-size: 1rem;
}

.ach-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ach-reward {
  font-size: 0.75rem;
  color: #fbbf24;
  margin-top: 4px;
}

/* --- Toasts --- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
}

.game-toast {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--border-accent);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  font-weight: 600;
}

/* --- Auth Modal Tabs & Inputs --- */
.btn-auth-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-auth-tab:hover {
  color: var(--text-main);
  background: rgba(22, 119, 210, 0.07);
}

.btn-auth-tab.tab-active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.auth-input:focus {
  outline: none;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* ==========================================================================
   Smooth Fade-In From Ground (First-Load & Section Entrance)
   ========================================================================== */

@keyframes textFlicker {
  0%, 100% { filter: brightness(1); }
  28% { filter: brightness(0.48); }
  31% { filter: brightness(1); }
  64% { filter: brightness(0.68); }
  67% { filter: brightness(1); }
  84% { filter: brightness(0.78); }
  87% { filter: brightness(1); }
}

@keyframes riseFromGround {
  0% {
    opacity: 0;
    transform: translateY(32px);
  }
  60% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* First load staggered rise */
.brand-section {
  animation: riseFromGround 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.player-status-bar {
  animation: riseFromGround 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.menu-hero h1 {
  animation: riseFromGround 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both,
             textFlicker 1.2s steps(1, end) 0.18s both;
}

.menu-hero p {
  animation: riseFromGround 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both,
             textFlicker 1.2s steps(1, end) 0.18s both;
}

.brand-title,
.brand-subtitle,
.menu-card-title,
.menu-card-desc {
  animation: textFlicker 1.2s steps(1, end) 0.2s both;
}

.menu-grid .menu-card:nth-child(1) {
  animation: riseFromGround 1.3s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

.menu-grid .menu-card:nth-child(2) {
  animation: riseFromGround 1.3s cubic-bezier(0.16, 1, 0.3, 1) 0.55s both;
}

.menu-grid .menu-card:nth-child(3) {
  animation: riseFromGround 1.3s cubic-bezier(0.16, 1, 0.3, 1) 0.65s both;
}

.menu-grid .menu-card:nth-child(4) {
  animation: riseFromGround 1.3s cubic-bezier(0.16, 1, 0.3, 1) 0.75s both;
}

/* View transitions ground rise */
.view-screen:not(.hidden) h2 {
  animation: riseFromGround 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both,
             textFlicker 1.2s steps(1, end) 0.1s both;
}

.modal-header h2 {
  animation: riseFromGround 0.6s cubic-bezier(0.16, 1, 0.3, 1) both,
             textFlicker 1.2s steps(1, end) 0.1s both;
}

@media (prefers-reduced-motion: reduce) {
  .brand-title,
  .brand-subtitle,
  .menu-hero h1,
  .menu-hero p,
  .menu-card-title,
  .menu-card-desc,
  .view-screen:not(.hidden) h2,
  .modal-header h2 {
    animation-name: none;
  }
}
