/* === ROOT VARIABLES === */
:root {
  --bg: #faf7f2;
  --bg2: #f2ede4;
  --card: #ffffff;
  --ink: #1c1710;
  --ink2: #6b6050;
  --ink3: #a89880;
  --accent: #c84b2f;
  --accent2: #e8703a;
  --border: #e0d8cc;
  --border2: #cfc6b8;
  --shadow: rgba(28, 23, 16, 0.10);
}

/* === BASIC RESET & BODY === */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  background: var(--bg);
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === BACKGROUND TEXTURE === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(200,146,42,0.06) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(200,75,47,0.05) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

/* === HEADER === */
header {
  position: relative; 
  z-index: 1;
  padding: 48px 24px 32px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.header-eyebrow {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--ink3);
  text-transform: uppercase;
  margin-bottom: 12px;
}

header h1 {
  font-family: 'Gowun Batang', serif;
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -1px;
}

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

header h1 span {
  color: var(--accent);
}

.header-sub {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink2);
  font-weight: 300;
}

/* === MAIN CONTENT === */
main {
  position: relative; 
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 20px 60px;
}

/* === OPTIONS GRID & SELECTS === */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.option-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--ink3);
  text-transform: uppercase;
}

.styled-select {
  width: 100%;
  padding: 14px;
  font-family: 'Gowun Batang', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink2);
  background-color: var(--card);
  border: 1px solid var(--border2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a89880' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.styled-select:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* === RESULT CARD === */
.result-wrap {
  position: relative;
  margin-bottom: 20px;
}

.result-wrap::before {
  content: '';
  position: absolute;
  inset: 6px -6px -6px 6px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: var(--bg2);
  z-index: 0;
}

.result-card {
  position: relative; 
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 28px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.15s;
}

.result-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity 0.3s;
}

.result-card.has-result::after { 
  opacity: 1; 
}

.empty-msg {
  text-align: center;
  color: var(--ink3);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8;
}

.empty-msg strong {
  display: block;
  font-family: 'Gowun Batang', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink2);
  margin-bottom: 6px;
}

.result-content { 
  animation: fadeIn 0.4s ease; 
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tag {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.tag-cat  { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a555; }
.tag-meal { background: #fff3e0; color: #b45309; border: 1px solid #fcd34d55; }

.menu-name {
  font-family: 'Gowun Batang', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.menu-desc {
  font-size: 15px;
  color: var(--ink2);
  line-height: 1.75;
  font-weight: 400;
}

/* === BUTTONS === */
.btn-spin {
  width: 100%;
  padding: 18px 24px;
  font-family: 'Gowun Batang', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  color: white;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s, transform 0.1s;
  margin-bottom: 12px;
}

.btn-spin::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
}

.btn-spin:hover { background: var(--accent2); }
.btn-spin:active { transform: scale(0.98); }
.btn-spin .dice { margin-right: 10px; display: inline-block; transition: transform 0.3s; }
.btn-spin:hover .dice { transform: rotate(180deg); }

.btn-again {
  width: 100%;
  padding: 12px;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  color: var(--ink2);
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-again:hover { 
  background: var(--bg2); 
  color: var(--ink); 
  border-color: var(--border); 
}

/* === FOOTER === */
footer {
  position: relative; 
  z-index: 1;
  text-align: center;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink3);
}

.footer-links {
  display: flex; 
  justify-content: center; 
  gap: 20px; 
  margin-top: 16px;
  font-family: 'Noto Sans KR', sans-serif;
}

.footer-links a { 
  color: var(--ink3); 
  text-decoration: none; 
  font-size: 13px; 
  transition: color 0.2s; 
  padding: 0 5px; 
}

.footer-links a:hover { color: var(--ink); }

/* === ANIMATIONS === */
@keyframes fadeIn { 
  from { opacity: 0; transform: translateY(6px); } 
  to { opacity: 1; transform: translateY(0); } 
}

@keyframes pop {
  0% { transform: scale(0.96); opacity: 0.7; }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); opacity: 1; }
}

.popped { 
  animation: pop 0.3s cubic-bezier(.34,1.56,.64,1); 
}

/* === MEDIA QUERIES === */
@media (max-width: 480px) {
  header { padding: 36px 20px 24px; }
  .menu-name { font-size: 28px; }
  .result-card { padding: 24px 20px; }
  .options-grid { grid-template-columns: 1fr; }
  .footer-links { flex-wrap: wrap; gap: 10px 20px; }
}
