/* 果汁手牌小測驗 — 果汁先生
 * 手機直向優先，純靜態樣式，無需編譯。
 */

:root {
  --bg: #140c08;
  --bg-2: #1e110b;
  --ink: #fff6ea;
  --ink-dim: #d7b89a;
  --muted: #a88970;
  --juice: #ff7a18;
  --juice-deep: #e85d00;
  --gold: #f3c94b;
  --lime: #d4f26a;
  --fold: #8f2d36;
  --fold-ink: #ffe8ea;
  --call: #ff7a18;
  --call-ink: #2a1206;
  --raise: #f3c94b;
  --raise-ink: #2a1c04;
  --card: #fff8f0;
  --card-back: #3a1d12;
  --ok: #b6e85a;
  --bad: #ff8a8a;
  --line: rgba(255, 214, 170, 0.16);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-synthesis: none;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -10%, rgba(255, 122, 24, 0.28), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(243, 201, 75, 0.12), transparent 36%),
    linear-gradient(180deg, #1c100b 0%, var(--bg) 38%, #0d0806 100%);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}

img,
svg {
  display: block;
}

.app {
  width: min(430px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(16px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
  position: relative;
}

[hidden] {
  display: none !important;
}

.brand-mark {
  width: min(210px, 64vw);
  height: auto;
  margin: 0 auto 12px;
  filter: drop-shadow(0 10px 22px rgba(255, 122, 24, 0.35));
}

.eyebrow,
.share-brand,
.ig-link,
.disclaimer,
.meta-label,
.progress-label,
.best-score {
  letter-spacing: 0.06em;
}

/* —— 開始頁 —— */
.screen-start,
.screen-end {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100dvh - 36px - var(--safe-top) - var(--safe-bottom));
  text-align: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 700;
}

.game-title {
  margin: 0 0 10px;
  font-size: clamp(2.3rem, 12vw, 3.2rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.lede {
  margin: 0 auto 28px;
  max-width: 22em;
  color: var(--ink-dim);
  font-size: 1.05rem;
  line-height: 1.55;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 58px;
  padding: 0.85rem 1.4rem;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
  filter: brightness(0.95);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(180deg, #ff9a3d 0%, var(--juice) 60%, var(--juice-deep) 100%);
  color: var(--call-ink);
}

#start-btn {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.btn-secondary {
  width: 100%;
  background: rgba(255, 246, 234, 0.08);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.disclaimer {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.ig-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
}

.best-score {
  margin: 16px 0 0;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

/* —— 對局頁 —— */
.play-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.play-brand {
  font-weight: 800;
  font-size: 0.95rem;
}

.progress-label {
  color: var(--ink-dim);
  font-size: 0.82rem;
  font-weight: 700;
}

.progress-dots {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.progress-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 246, 234, 0.18);
}

.progress-dots span.is-done {
  background: var(--juice);
}

.progress-dots span.is-current {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(243, 201, 75, 0.22);
}

.situation-card {
  background: rgba(255, 246, 234, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin-bottom: 16px;
}

.street-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(243, 201, 75, 0.14);
  color: var(--gold);
}

.situation-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

.table {
  background:
    linear-gradient(180deg, rgba(255, 122, 24, 0.08), transparent 40%),
    rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 16px 12px 18px;
  margin-bottom: 14px;
}

.table-label {
  margin: 0 0 10px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hole-cards,
.board-cards {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
}

.hole-cards {
  min-height: 132px;
  margin-bottom: 4px;
}

.hole-cards .playing-card:first-child {
  transform: rotate(-7deg) translateY(4px);
}

.hole-cards .playing-card:last-child {
  transform: rotate(7deg) translateY(4px);
}

.board-wrap {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.board-cards .playing-card {
  width: 52px;
  height: 74px;
  border-radius: 10px;
}

.playing-card {
  width: 86px;
  height: 122px;
  background: var(--card);
  color: #1a120c;
  border-radius: 14px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 9px 10px;
  user-select: none;
  position: relative;
}

.playing-card.is-red {
  color: #d0132d;
}

.playing-card.is-black {
  color: #17110e;
}

.card-rank {
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.board-cards .card-rank {
  font-size: 1.05rem;
}

.card-suit {
  font-size: 1.8rem;
  line-height: 1;
  align-self: flex-end;
}

.board-cards .card-suit {
  font-size: 1.25rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.meta-item {
  background: rgba(255, 246, 234, 0.05);
  border-radius: 16px;
  padding: 10px 8px;
  text-align: center;
}

.meta-label {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  margin-bottom: 4px;
  font-weight: 700;
}

.meta-value {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.25;
}

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

.btn-fold,
.btn-call,
.btn-raise {
  min-height: 64px;
  font-size: 1.25rem;
}

.btn-fold {
  background: var(--fold);
  color: var(--fold-ink);
}

.btn-call {
  background: linear-gradient(180deg, #ff9a3d, var(--call));
  color: var(--call-ink);
}

.btn-raise {
  grid-column: 1 / -1;
  background: var(--raise);
  color: var(--raise-ink);
}

.feedback {
  position: relative;
  overflow: hidden;
  background: rgba(255, 246, 234, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.feedback.is-correct {
  background-color: #160e0a;
  background-image:
    linear-gradient(180deg, rgba(12, 8, 6, 0.42), rgba(12, 8, 6, 0.62)),
    url("logo-juicy.png");
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: cover, 118% auto;
  border-color: rgba(255, 122, 24, 0.42);
}

.feedback.is-correct .feedback-verdict,
.feedback.is-correct .feedback-text {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95), 0 0 16px rgba(0, 0, 0, 0.8);
}

.feedback.is-correct .btn,
.feedback.is-correct .feedback-verdict,
.feedback.is-correct .feedback-text {
  position: relative;
  z-index: 1;
}

.feedback-verdict {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.35;
}

.feedback.is-correct .feedback-verdict {
  color: var(--ok);
}

.feedback.is-wrong .feedback-verdict {
  color: var(--bad);
}

.feedback-text {
  margin: 0 0 16px;
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.6;
}

/* —— 結束頁 —— */
.share-card {
  text-align: left;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 122, 24, 0.28), transparent 42%),
    linear-gradient(165deg, #2a160e 0%, #140c08 55%, #201009 100%);
  border: 1px solid rgba(243, 201, 75, 0.28);
  border-radius: 28px;
  padding: 24px 22px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.share-brand {
  margin: 0;
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
}

.share-title {
  margin: 6px 0 18px;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.15;
}

.share-score {
  margin: 0 0 6px;
  font-size: clamp(3.4rem, 18vw, 4.6rem);
  line-height: 0.9;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.share-score span {
  font-size: 0.45em;
  color: var(--ink-dim);
}

.share-comment {
  margin: 16px 0 18px;
  font-size: 1.2rem;
  line-height: 1.45;
  font-weight: 700;
}


.share-prize {
  margin: 0.85rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: #ff4d6d;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.share-prize[hidden] {
  display: none;
}

.share-handle {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.end-actions {
  display: grid;
  gap: 10px;
}

@media (min-width: 500px) {
  body {
    background-color: #0a0605;
  }

  .app {
    box-shadow: 0 0 0 1px rgba(255, 214, 170, 0.08), 0 30px 80px rgba(0, 0, 0, 0.45);
    background: transparent;
  }
}

@media (max-height: 700px) {
  .playing-card {
    width: 72px;
    height: 102px;
  }

  .hole-cards {
    min-height: 110px;
  }

  .game-title {
    font-size: 2.2rem;
  }

  .brand-mark {
    width: min(160px, 52vw);
    margin-bottom: 8px;
  }
}
