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

body {
  background-color: #eae7d9;
  color: #000;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  min-height: 100vh;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 40px 48px;
}

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

.logo {
  display: block;
  height: 84px;
  width: auto;
}

.stats {
  display: flex;
  gap: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.game {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.game-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-image {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-self: start;
  height: auto;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
}

.dish-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  flex: 0 0 auto;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.image-caption {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 400;
  color: #9a9a9a;
  line-height: 1.4;
}

.card-info {
  position: relative;
  padding: 28px;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  box-shadow: none;
  clip-path: url(#receipt-clip);
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.25));
}

.card-guess {
  padding: 20px 28px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
}

.guess-section {
  margin-bottom: 0;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.info-section {
  margin-bottom: 28px;
}

.info-section:last-child {
  margin-bottom: 0;
}

.info-heading {
  display: block;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}

.info-text {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
}

.info-text.muted {
  color: #9a9a9a;
}

.select-wrap {
  position: relative;
  width: 100%;
  margin-top: 8px;
}

.guess-input {
  width: 100%;
  padding: 10px 12px;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 400;
  color: #000;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  outline: none;
}

.suggestions {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 6px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
  z-index: 10;
}

.suggestions.hidden {
  display: none;
}

.suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: #f0efe8;
}

.suggestion-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: #9a9a9a;
}

.guess-input:focus {
  border-color: #888;
}

.guess-input:disabled {
  background: #f5f5f5;
  color: #666;
}

.feedback {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  min-height: 18px;
}

.feedback.correct {
  color: #2d6a2d;
}

.feedback.incorrect {
  color: #8b3a3a;
}

.hidden {
  display: none !important;
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(234, 231, 217, 0.92);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 10;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  width: min(680px, 96vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
}

.modal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.results-summary {
  font-size: 14px;
  line-height: 1.5;
}

.results-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.result-item {
  background: #f8f7f2;
  border: 1px solid #e0ddd0;
  border-radius: 6px;
  padding: 10px;
}

.result-item .line {
  display: flex;
  gap: 10px;
  align-items: center;
}

.result-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.result-item strong {
  font-weight: 700;
}

.result-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #666;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.primary-btn,
.secondary-btn {
  appearance: none;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.primary-btn {
  border: 1px solid #c8c8c8;
  background: #000;
  color: #fff;
}

.primary-btn:hover {
  background: #222;
}

.secondary-btn {
  border: 1px solid #c8c8c8;
  background: #fff;
  color: #000;
}

.secondary-btn:hover {
  background: #f5f5f5;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
}

.site-footer {
  margin-top: 32px;
  font-size: 11px;
  font-weight: 400;
  color: #9a9a9a;
  text-align: center;
}

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

.site-footer a:hover {
  color: #666;
}

@media (max-width: 768px) {
  .page {
    padding: 24px 20px calc(160px + env(safe-area-inset-bottom, 0px));
  }

  .game {
    grid-template-columns: 1fr;
  }

  .stats {
    gap: 24px;
  }

  .card-guess {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    margin: 0;
    border-radius: 8px 8px 0 0;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
  }

  .guess-input {
    font-size: 16px;
  }

  .suggestions {
    max-height: min(220px, 40vh);
  }

  .toast {
    bottom: calc(150px + env(safe-area-inset-bottom, 0px));
  }
}
