:root {
  --bg: #120f0d;
  --panel: rgba(37, 28, 22, 0.92);
  --panel-border: rgba(255, 224, 191, 0.1);
  --text: #fff6ee;
  --muted: #d9c2b1;
  --accent: #ff8f3d;
  --accent-strong: #ff6b2d;
  --shadow: 0 28px 60px rgba(0, 0, 0, 0.32);
  --radius-xl: 28px;
  --radius-lg: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 160, 90, 0.2), transparent 32%),
    radial-gradient(circle at 85% 15%, rgba(255, 107, 45, 0.16), transparent 22%),
    linear-gradient(135deg, #0d0a08 0%, #15100d 45%, #1f1713 100%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1260px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 28px 30px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255, 146, 70, 0.18), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow,
.panel-tag {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ffd2a9;
  font-size: 12px;
}

.hero h1,
.panel-header h2,
.result-card h3,
.menu-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.98;
}

.hero-text {
  max-width: 680px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 320px;
}

.hero-badge,
.status-bar {
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-badge span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 14px;
}

.hero-badge strong {
  font-size: 24px;
}

.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-btn,
.primary-btn,
.ghost-btn,
.icon-btn {
  border: 0;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.mode-btn:hover,
.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
}

.mode-btn {
  padding: 16px 18px;
  border-radius: 18px;
  color: #fff0e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700;
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 16px 30px rgba(255, 107, 45, 0.28);
}

.status-bar {
  margin: 18px 0 22px;
  color: #ffe2c8;
}

.status-bar.error {
  color: #ffd0d0;
  background: rgba(111, 19, 19, 0.34);
}

.status-bar.success {
  color: #dbffdf;
  background: rgba(22, 82, 26, 0.28);
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.menu-layout,
.wheel-layout {
  display: grid;
  gap: 22px;
}

.menu-layout {
  grid-template-columns: 1.02fr 1.08fr;
}

.wheel-layout {
  grid-template-columns: 1fr 0.72fr;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-header h2 {
  font-size: 30px;
  line-height: 1.1;
}

.panel-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  color: #ffe8d5;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.dish-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field span {
  color: #ffe5cf;
  font-size: 14px;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.field input:focus {
  outline: 2px solid rgba(255, 143, 61, 0.28);
  border-color: rgba(255, 143, 61, 0.5);
}

.preview-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 18px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.preview-image {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  border-radius: 18px;
  background-size: cover;
  background-position: center;
}

.preview-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 10%, rgba(0, 0, 0, 0.28) 100%);
}

.preview-image.empty {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255, 143, 61, 0.2), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
}

.preview-image.empty::after {
  display: none;
}

.preview-image span {
  position: relative;
  z-index: 1;
  color: #ffdebf;
}

.preview-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.preview-copy strong {
  font-size: 18px;
}

.preview-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.primary-btn {
  padding: 15px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff7f0;
  font-weight: 700;
  box-shadow: 0 16px 30px rgba(255, 107, 45, 0.28);
}

.primary-btn:disabled,
.ghost-btn:disabled,
.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.ghost-btn {
  padding: 13px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffe8d8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ghost-btn.small {
  padding: 10px 14px;
}

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

.menu-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.menu-thumb-wrap {
  overflow: hidden;
  border-radius: 18px;
}

.menu-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.menu-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.menu-name {
  font-size: 22px;
}

.menu-time {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-btn {
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(255, 107, 45, 0.16);
  color: #ffd7c1;
}

.empty-state {
  display: none;
  place-items: center;
  min-height: 180px;
  padding: 18px;
  border-radius: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: #fff0e2;
  font-size: 22px;
}

.empty-state.visible {
  display: grid;
}

.wheel-panel {
  position: relative;
  overflow: hidden;
}

.wheel-panel::before {
  content: "";
  position: absolute;
  inset: auto -80px -90px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 143, 61, 0.24), transparent 70%);
  pointer-events: none;
}

.wheel-wrap {
  position: relative;
  display: grid;
  place-items: center;
  margin: 12px 0 18px;
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  z-index: 2;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 34px solid #fff3e8;
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.32));
}

#wheel-canvas {
  width: min(100%, 460px);
  height: auto;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.15));
  box-shadow:
    inset 0 0 0 12px rgba(255, 255, 255, 0.08),
    0 24px 36px rgba(0, 0, 0, 0.24);
}

.wheel-actions {
  display: flex;
  gap: 12px;
}

.wheel-actions > * {
  flex: 1;
}

.result-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 143, 61, 0.16), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-label {
  margin: 0 0 6px;
  color: #ffd4b0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.result-card h3 {
  font-size: 30px;
}

.result-card p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.shortlist {
  display: grid;
  gap: 12px;
}

.shortlist-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.shortlist-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
}

.shortlist-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortlist-name {
  font-size: 18px;
}

.shortlist-time {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1050px) {
  .menu-layout,
  .wheel-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-side {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1260px);
    padding-top: 16px;
  }

  .hero,
  .panel {
    padding: 18px;
    border-radius: 24px;
  }

  .hero-actions,
  .wheel-actions,
  .panel-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .preview-card {
    grid-template-columns: 1fr;
  }

  .panel-header {
    flex-direction: column;
  }
}
