/* ===== 物件ガチャ ===== */
.est-head { background: linear-gradient(135deg, #1d2433, #2c3650); color: #fff; border-radius: 18px; padding: 16px 16px 12px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(20,30,60,0.25); }
.est-head-label { font-size: 11px; color: #c9d2e6; letter-spacing: 1px; }
.est-head-total { font-size: 30px; font-weight: 900; color: #ffd257; line-height: 1.2; font-variant-numeric: tabular-nums; word-break: break-all; }
.est-head-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.est-head-row div { background: rgba(255,255,255,0.08); border-radius: 10px; padding: 6px 8px; min-width: 0; }
.est-head-row span { display: block; font-size: 10px; color: #c9d2e6; }
.est-head-row b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-head-next { font-size: 11px; color: #c9d2e6; margin-top: 8px; text-align: center; }
.est-tabs { display: flex; gap: 6px; margin-bottom: 14px; background: #f0f1f5; padding: 6px; border-radius: 12px; border: 1px solid var(--border); }
.est-tabs .sub-tab-btn { font-size: 12px; padding: 8px 4px; }

.est-pack-row { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 14px; margin-bottom: 14px; box-shadow: 0 3px 12px rgba(0,0,0,0.06); align-items: center; }
.est-pack-info { flex: 1; min-width: 0; }
.est-pack-title { font-size: 17px; font-weight: 900; color: var(--area); }
.est-pack-desc { font-size: 12px; color: var(--text-sub); margin: 2px 0 6px; line-height: 1.5; }
.est-pack-meta { font-size: 11px; color: var(--text-main); font-weight: bold; margin-bottom: 8px; }
.est-pack-btns { display: flex; gap: 6px; }
.est-pack-btns .btn { flex: 1; font-size: 12px; padding: 9px 4px; }
.est-free-btn { width: 100%; margin-bottom: 6px; font-size: 13px; padding: 10px; animation: pulse-btn 1.2s infinite; }
.est-rate-link { display: inline-block; font-size: 11px; color: var(--accent-blue); margin-top: 6px; cursor: pointer; text-decoration: underline; }
.est-note { font-size: 11px; color: var(--text-sub); line-height: 1.7; margin: 6px 2px 14px; }

/* パック */
.est-pack { position: relative; width: 200px; aspect-ratio: 63 / 88; border-radius: 14px; background: linear-gradient(160deg, var(--area), var(--area2)); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.45), inset 0 0 0 3px rgba(255,255,255,0.25); user-select: none; }
.est-pack::before { content: ''; position: absolute; inset: 8px; border: 1.5px dashed rgba(255,255,255,0.35); border-radius: 10px; }
.est-pack-icon { font-size: 64px; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35)); }
.est-pack-name { font-size: 18px; font-weight: 900; margin-top: 6px; letter-spacing: 1px; }
.est-pack-sub { font-size: 10px; letter-spacing: 3px; opacity: 0.8; }
.est-pack-shine { position: absolute; top: -50%; left: -80%; width: 50%; height: 200%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent); transform: rotate(25deg); animation: estShine 2.4s infinite; }
.est-pack-thumb { width: 92px; flex-shrink: 0; border-radius: 10px; }
.est-pack-thumb .est-pack-icon { font-size: 34px; }
.est-pack-thumb .est-pack-name { font-size: 10px; margin-top: 2px; }
.est-pack-thumb .est-pack-sub { font-size: 7px; letter-spacing: 1px; }
.est-pack-thumb::before { inset: 4px; }
.est-pack-hot { box-shadow: 0 0 0 3px #ffd257, 0 0 40px rgba(255,210,87,0.9); animation: estHot 0.5s infinite alternate; }
.est-pack-open { animation: estTear 0.28s ease-in forwards; }
@keyframes estShine { 0% { left: -80%; } 60%, 100% { left: 130%; } }
@keyframes estHot { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
@keyframes estTear { to { transform: translateY(-60px) scale(1.1); opacity: 0; } }

/* 物件カード */
.est-card { position: relative; width: 240px; aspect-ratio: 63 / 88; border-radius: 14px; background: #fff; border: 4px solid var(--ring); box-shadow: 0 0 24px var(--glow), 0 8px 20px rgba(0,0,0,0.25); display: flex; flex-direction: column; overflow: hidden; color: #1a1a1a; }
.est-card-top { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(90deg, var(--area), var(--area2)); color: #fff; padding: 6px 10px; font-weight: bold; font-size: 13px; }
.est-station { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-rar { font-size: 11px; padding: 1px 8px; border-radius: 10px; color: #fff; flex-shrink: 0; }
.est-card-art { flex: 1; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #ffffff, #eef1f6); position: relative; }
.est-emoji { font-size: 84px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.18)); }
.est-card-name { text-align: center; font-weight: 900; font-size: 17px; padding: 6px 8px 0; line-height: 1.3; min-height: 28px; }
.est-card-price { text-align: center; font-weight: 900; font-size: 30px; color: #c0392b; letter-spacing: -0.5px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.est-card-inc { text-align: center; font-size: 11px; color: var(--text-sub); padding-bottom: 8px; }
.est-r-SSR { background: linear-gradient(160deg, #fff8dc, #fff); }
.est-r-SSR .est-card-art { background: radial-gradient(circle at 50% 40%, #fffbe8, #f7e2a0); }
.est-r-SSR::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.7) 45%, transparent 60%); background-size: 250% 100%; animation: estHolo 2.2s infinite; pointer-events: none; }
.est-r-SR .est-card-art { background: radial-gradient(circle at 50% 40%, #fbf3ff, #e7d3f5); }
@keyframes estHolo { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.est-mini { width: 100%; border-width: 2px; border-radius: 9px; box-shadow: 0 0 10px var(--glow), 0 2px 6px rgba(0,0,0,0.12); }
.est-mini .est-card-top { padding: 3px 6px; font-size: 10px; gap: 4px; }
.est-mini .est-rar { font-size: 8px; padding: 0 4px; }
.est-mini .est-emoji { font-size: 34px; }
.est-mini .est-card-name { font-size: 11px; padding: 3px 4px 0; min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-mini .est-card-price { font-size: 15px; white-space: nowrap; }
.est-mini .est-card-inc { font-size: 9px; padding-bottom: 4px; white-space: nowrap; }
.est-locked { filter: grayscale(1); opacity: 0.45; box-shadow: none; }
.est-flip-in { animation: estFlip 0.42s cubic-bezier(.2,.8,.2,1) both; }
@keyframes estFlip { 0% { transform: rotateY(90deg) scale(0.7); } 70% { transform: rotateY(-8deg) scale(1.05); } 100% { transform: rotateY(0) scale(1); } }

/* 開封画面 */
#est-reveal { position: fixed; inset: 0; z-index: 7500; background: radial-gradient(circle at 50% 40%, #2b2f3d, #0d0f15); display: none; flex-direction: column; align-items: center; justify-content: center; touch-action: none; user-select: none; overflow: hidden; }
.est-rv-stage { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 380px; perspective: 900px; }
.est-rv-card { position: relative; z-index: 2; }
.est-rv-hint { color: #c9d2e6; font-size: 13px; margin-top: 18px; animation: estBlink 1.4s infinite; }
.est-rv-count { color: #8a93a8; font-size: 12px; margin-top: 8px; }
.est-rv-skip { position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.25); border-radius: 20px; padding: 6px 14px; font-size: 12px; cursor: pointer; }
.est-tag { margin-top: 14px; font-weight: 900; font-size: 15px; padding: 5px 14px; border-radius: 20px; position: relative; z-index: 2; }
.est-tag-new { background: #ffd257; color: #3a2a00; }
.est-tag-dup { background: rgba(255,255,255,0.14); color: #e6e9f0; font-size: 13px; }
.est-rays { position: absolute; top: 50%; left: 50%; width: 700px; height: 700px; margin: -380px 0 0 -350px; background: repeating-conic-gradient(rgba(255,210,87,0.35) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: estSpin 6s linear infinite; z-index: 1; pointer-events: none; -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); mask: radial-gradient(circle, #000 20%, transparent 65%); }
.est-shake { animation: estShake 0.45s; }
@keyframes estSpin { to { transform: rotate(360deg); } }
@keyframes estBlink { 50% { opacity: 0.35; } }
@keyframes estShake { 0%, 100% { transform: translate(0,0); } 20% { transform: translate(-8px, 4px); } 40% { transform: translate(7px, -5px); } 60% { transform: translate(-5px, 3px); } 80% { transform: translate(4px, -2px); } }

/* 結果まとめ */
.est-sum { width: 100%; max-width: 520px; height: 100%; overflow-y: auto; padding: 18px 16px 24px; color: #fff; touch-action: pan-y; }
.est-sum-title { font-size: 18px; font-weight: 900; text-align: center; margin-bottom: 10px; }
.est-sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.est-sum-stats div { background: rgba(255,255,255,0.08); border-radius: 10px; padding: 8px; text-align: center; min-width: 0; }
.est-sum-stats span { display: block; font-size: 10px; color: #c9d2e6; }
.est-sum-stats b { display: block; font-size: 14px; color: #ffd257; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.est-sum-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.est-sum-item { position: relative; min-width: 0; }
.est-sum-tag { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 900; padding: 1px 5px; border-radius: 8px; z-index: 3; }
.est-sum-tag.n { background: #ffd257; color: #3a2a00; }
.est-sum-tag.d { background: #5a6070; color: #fff; }
.est-sum-btns .btn { margin-bottom: 8px; }

/* 決算・提供割合 */
.est-settle { background: #fff; color: var(--text-main); width: calc(100% - 32px); max-width: 380px; border-radius: 18px; padding: 20px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.est-settle-head { font-size: 18px; font-weight: 900; color: var(--gold); }
.est-settle-sub { font-size: 12px; color: var(--text-sub); margin: 4px 0 10px; line-height: 1.6; }
.est-settle-big { font-size: 32px; font-weight: 900; color: #c0392b; margin-bottom: 10px; }
.est-settle-line { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 2px; border-top: 1px solid var(--border); }
.est-rates { max-height: 85vh; display: flex; flex-direction: column; }
.est-rate-list { overflow-y: auto; text-align: left; flex: 1; }
.est-rate-h { font-size: 13px; margin: 10px 0 4px; color: var(--gold); }
.est-rate-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; border-bottom: 1px dashed var(--border); gap: 8px; }

/* 物件一覧 */
.est-area-h { font-size: 15px; font-weight: 900; color: var(--area); margin: 16px 2px 8px; }
.est-station-box { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
.est-station-box.mono { border-color: #f2b705; box-shadow: 0 0 12px rgba(242,183,5,0.3); background: #fffdf3; }
.est-station-h { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.est-station-h span { font-size: 11px; color: var(--text-sub); font-weight: bold; }
.est-station-box.mono .est-station-h span { color: #b88700; }
.est-station-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* ガチャ画面の導線 */
.est-banner { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #1d2433, #2c3650); color: #fff; border-radius: 16px; padding: 14px; margin-bottom: 16px; cursor: pointer; box-shadow: 0 6px 18px rgba(20,30,60,0.2); }
.est-banner-icon { font-size: 34px; }
.est-banner b { display: block; font-size: 15px; color: #ffd257; }
.est-banner span { font-size: 11px; color: #c9d2e6; }

@media (min-width: 560px) {
  .est-sum-grid { grid-template-columns: repeat(5, 1fr); }
  .est-station-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 360px) {
  .est-card { width: 210px; }
  .est-card-price { font-size: 26px; }
}

.est-mini { min-width: 0; }

/* 演出の中のボタンは光の演出より手前に出す */
.est-rv-stage .btn { position: relative; z-index: 3; }
