/* ทำเนียบธิดาผ้าไหมในฝัน (/dream-throne) */
.dream { padding-bottom: 110px; }
.dream__head { text-align: center; max-width: 760px; margin: 0 auto 18px; }
.dream__head h1 { font-size: clamp(1.5rem, 4.6vw, 2.6rem); line-height: 1.25; color: #fff4dc; margin: 6px 0 8px; overflow-wrap: anywhere; }
.dream__note { font-size: .86rem; color: #e5dcc6; line-height: 1.7; }
.dream__note b { color: #f2d9a2; font-weight: 600; }

.dream__steps { list-style: none; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 0; margin: 0 auto 22px; counter-reset: s; }
.dream__steps li { counter-increment: s; font-size: .78rem; padding: 6px 12px; border-radius: 99px; border: 1px solid #d9bd8444; color: #cdbf9f; cursor: pointer; white-space: nowrap; }
.dream__steps li::before { content: counter(s) '. '; opacity: .7; }
.dream__steps li.is-done { color: #f2d9a2; border-color: #d9bd8488; }
.dream__steps li.is-on { background: linear-gradient(135deg, #e8c98a, #c9a25a); color: #1b2e26; border-color: transparent; font-weight: 600; }

.dream__panel { max-width: 1100px; margin: 0 auto; }
.dream__panel h2 { text-align: center; font-size: 1.3rem; color: #f6e7c4; margin: 0 0 4px; }
.dream__panel > .help { text-align: center; color: #d9cfb8; margin: 0 0 16px; font-size: .88rem; }

.dream__name { max-width: 460px; display: grid; gap: 10px; padding: 24px; border-radius: 18px; background: linear-gradient(160deg, #1f3a30, #132a22); border: 1px solid #d9bd8455; }
.dream__name input { font: inherit; font-size: 1.1rem; padding: 12px 14px; border-radius: 12px; border: 1px solid #d9bd8477; background: #0e221b; color: #fff; text-align: center; }
.dream__name input:focus { outline: 2px solid #e8c98a; outline-offset: 1px; }
.dream__err { color: #ffb4a8; font-size: .85rem; margin: 0; text-align: center; }

.dream__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .dream__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; } }
.dream-card { position: relative; display: grid; gap: 2px; padding: 8px 8px 10px; border-radius: 16px; border: 1px solid #d9bd8433; background: linear-gradient(170deg, #213d32, #132a22); color: #f6eedf; text-align: center; cursor: pointer; font: inherit; transition: transform .15s, border-color .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.dream-card:hover { transform: translateY(-2px); }
.dream-card__img { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 12px 12px 8px 8px; overflow: hidden; background: #d9c398; }
.dream-card__img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.dream-card__img i { position: absolute; left: 6px; top: 6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px; background: #0f2a22dd; color: #f2d9a2; font: 600 .78rem/26px inherit; font-style: normal; }
.dream-card b { font-size: .92rem; margin-top: 6px; line-height: 1.3; }
.dream-card small { font-size: .7rem; color: #cdbf9f; line-height: 1.35; overflow-wrap: anywhere; }
.dream-card em { position: absolute; right: 8px; top: 8px; min-width: 30px; height: 30px; padding: 0 9px; border-radius: 99px; background: linear-gradient(135deg, #f0d79d, #c9a25a); color: #1b2e26; font: 700 .8rem/30px inherit; font-style: normal; box-shadow: 0 3px 8px #0006; }
.dream-card.is-ranked em { left: 8px; right: 8px; font-size: .72rem; line-height: 1.25; height: auto; padding: 6px; white-space: normal; }
.dream-card.is-on { border-color: #e8c98a; box-shadow: 0 0 0 2px #e8c98a66, 0 10px 22px #0006; }
.dream-card:not(.is-on) .dream-card__img img { filter: saturate(.9); }

.dream__bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px max(14px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom));
  background: #0c1f19f2; border-top: 1px solid #d9bd8455; backdrop-filter: blur(8px); }
.dream__bar span { font-size: .9rem; color: #f2d9a2; font-weight: 600; text-align: center; }
.dream__bar .btn { padding: 9px 16px; font-size: .9rem; min-height: 0; }
.dream__bar .btn[disabled] { opacity: .45; cursor: not-allowed; }

.dream__canvas-wrap { border-radius: 14px; overflow: hidden; box-shadow: 0 18px 40px #0008; border: 1px solid #d9bd8455; background: #0c2019; }
.dream__canvas-wrap img { display: block; width: 100%; height: auto; -webkit-touch-callout: default; }
.dream__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0 6px; }
.dream__actions .btn { padding: 10px 18px; font-size: .92rem; }
.dream__result > .help { text-align: center; }

/* `hidden` must win over the display rules above */
.dream [hidden] { display: none !important; }
.dream__year { font-size: 1.05rem; color: #e8c98a; margin: -2px 0 8px; letter-spacing: .04em; }
.dream__total { display: inline-block; margin-top: 10px; padding: 6px 16px; border-radius: 99px; border: 1px solid #d9bd8455; background: #0f2a22aa; font-size: .88rem; color: #e5dcc6; }
.dream__total b { color: #f2d9a2; font-size: 1.05rem; }
.dream__group { margin: 0 0 6px; text-align: center; color: #f2d9a2; font-size: .95rem; font-weight: 600; }
.dream__grid + .dream__group { margin-top: 22px; }
