/* ═══════════════ ARENA (sidebar-shell page, specs/arena-mode.md §7) ═══════════════ */

main { padding: 16px 16px 24px; box-sizing: border-box; }

/* ── gate ── */
.arena-gate { display: flex; justify-content: center; padding: 40px 16px; }
.arena-gate-box { max-width: 460px; text-align: center; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,191,0,0.35); border-radius: 14px; padding: 24px; }
.arena-gate-box-art { width: 200px; max-width: 60%; border-radius: 8px; box-shadow: 0 8px 30px rgba(255,120,0,0.35); margin-bottom: 14px; }
.arena-gate-box h2 { font-family: 'Dragon Slayer', serif; color: #ffbf00; font-size: 1.3rem; margin: 0 0 8px; }
.arena-gate-box p { color: rgba(240,236,230,0.75); margin: 0 0 16px; }
.arena-gate-or { display: block; color: rgba(240,236,230,0.5); margin: 10px 0; font-size: 0.8rem; }

/* ── shell ── */
.arena-shell { display: flex; gap: 20px; width: 100%; max-width: 1560px; min-width: 0; box-sizing: border-box; margin: 0 auto; text-align: left; }
.arena-sidebar { position: sticky; top: 140px; flex: 0 0 230px; height: calc(100vh - 242px); display: flex; flex-direction: column; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,191,0,0.3); border-radius: 12px; padding: 14px 10px; box-sizing: border-box; }
.arena-nav { display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; }
.arena-nav-group-label { font-family: 'HwyGothic', sans-serif; letter-spacing: 2px; font-size: 0.7rem; color: rgba(240,236,230,0.5); padding: 6px 10px 4px; }
.arena-tab { display: flex; align-items: center; gap: 10px; width: 100%; height: auto; /* override global button height */ padding: 10px 12px; background: transparent; border: none; border-radius: 8px; color: rgba(240,236,230,0.8); font-family: 'HwyGothic', sans-serif; font-size: 0.85rem; letter-spacing: 1px; cursor: pointer; text-align: left; }
.arena-tab:hover { background: rgba(255,191,0,0.08); color: #ffbf00; }
.arena-tab.active { background: rgba(255,191,0,0.14); color: #ffbf00; }
.arena-tab i { width: 18px; text-align: center; }
.arena-sidebar-foot { margin-top: auto; padding: 10px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.78rem; color: rgba(240,236,230,0.6); }
.arena-foot-line { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.arena-foot-line b { color: #ffbf00; }
.arena-content-col { flex: 1; min-width: 0; }
.arena-topbar { padding: 4px 0 12px; }
.arena-heading { font-family: 'Dragon Slayer', serif; color: #ffbf00; font-size: 1.8rem; margin: 0; letter-spacing: 2px; }
.arena-panel { display: none; }
.arena-panel.active { display: block; }

/* ── shared bits ── */
.arena-notice { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 14px 16px; color: rgba(240,236,230,0.8); }
.arena-notice a { color: #ffbf00; }
.arena-msg { min-height: 1.2em; font-size: 0.85rem; color: #9be39b; margin-top: 8px; }
.arena-msg-error { color: #ff7a7a; }
.arena-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 0.85rem; color: rgba(240,236,230,0.65); }
.arena-kv b { color: #ffbf00; font-weight: 700; }
.arena-btn { height: auto; /* override global button height */ padding: 11px 16px; display: inline-flex; align-items: center; gap: 8px; font-family: 'HwyGothic', sans-serif; letter-spacing: 1.5px; font-size: 0.8rem; border-radius: 10px; cursor: pointer; }
.arena-btn:disabled { opacity: 0.5; cursor: default; }
.arena-btn-danger { border-color: rgba(255,80,80,0.5); color: #ff8a8a; }
.arena-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.arena-select { background: #161616; color: #f0ece6; border: 1px solid rgba(255,191,0,0.35); border-radius: 8px; padding: 6px 10px; font-family: 'HwyGothic', sans-serif; }
.arena-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.88rem; }
.arena-table th { text-align: left; color: rgba(240,236,230,0.5); font-weight: normal; letter-spacing: 1px; font-size: 0.72rem; padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.arena-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.arena-table tr.me td { color: #ffbf00; }
.arena-empty { color: rgba(240,236,230,0.5); text-align: center; padding: 18px; }

/* ── enter: the box is the button ── */
.arena-enter { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 28px; align-items: start; }
.arena-box-btn { position: relative; height: auto; /* override global button height */ padding: 0; border: none; background: transparent; cursor: pointer; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 40px rgba(255,100,0,0.35); transition: transform .2s; display: block; width: 100%; }
.arena-box-btn:hover:not(:disabled) { transform: translateY(-4px) scale(1.01); }
.arena-box-btn:disabled { filter: grayscale(0.6) brightness(0.6); cursor: default; box-shadow: none; }
.arena-box-btn img { width: 100%; display: block; }
.arena-box-cta { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; background: linear-gradient(transparent, rgba(0,0,0,0.9)); color: #ffbf00; font-family: 'Dragon Slayer', serif; font-size: 1.15rem; letter-spacing: 2px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.arena-box-cta small { font-family: 'HwyGothic', sans-serif; color: #f0ece6; letter-spacing: 1px; font-size: 0.8rem; }
.arena-box-cta small:not(:empty)::before { content: '\1F48E\00a0'; }
.arena-enter-info h2 { font-family: 'Dragon Slayer', serif; color: #ffbf00; font-size: 1.4rem; margin: 0 0 8px; }
.arena-enter-info h3 { font-family: 'HwyGothic', sans-serif; color: rgba(240,236,230,0.6); letter-spacing: 2px; font-size: 0.75rem; margin: 18px 0 6px; }
.arena-enter-info p { color: rgba(240,236,230,0.8); margin: 0 0 12px; line-height: 1.5; }
.arena-blocked { margin-top: 10px; color: #ff9a6a; font-size: 0.85rem; }
.arena-odds { margin: 0; padding-left: 18px; color: rgba(240,236,230,0.8); font-size: 0.88rem; line-height: 1.6; }
.arena-prizes { border-collapse: collapse; font-size: 0.85rem; }
.arena-prizes th { text-align: left; color: rgba(240,236,230,0.5); font-weight: normal; font-size: 0.72rem; letter-spacing: 1px; padding: 4px 14px 4px 0; }
.arena-prizes td { padding: 4px 14px 4px 0; border-top: 1px solid rgba(255,255,255,0.06); }
.arena-prizes tr:last-child td { color: #ffbf00; font-weight: 700; }

/* ── active run ── */
.arena-record-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,191,0,0.3); border-radius: 14px; padding: 18px 20px; }
.arena-record-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.arena-record-label { font-family: 'HwyGothic', sans-serif; letter-spacing: 2px; color: rgba(240,236,230,0.55); font-size: 0.75rem; }
.arena-record-score { font-family: 'Dragon Slayer', serif; color: #ffbf00; font-size: 1.6rem; }
.arena-record-score small { font-family: 'HwyGothic', sans-serif; font-size: 0.75rem; color: rgba(240,236,230,0.6); letter-spacing: 1px; }
.arena-pips { display: flex; gap: 6px; margin: 10px 0 4px; }
.arena-pips span { width: 26px; height: 10px; border-radius: 5px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,191,0,0.3); }
.arena-pips span.on { background: #ffbf00; box-shadow: 0 0 8px rgba(255,191,0,0.6); }
.arena-pips-loss span { border-color: rgba(255,80,80,0.4); }
.arena-pips-loss span.on { background: #ff5252; box-shadow: 0 0 8px rgba(255,80,80,0.6); }
.arena-prize-now { margin-top: 12px; }

/* searching */
.arena-searching { margin-top: 16px; text-align: center; padding: 22px; border: 1px dashed rgba(255,191,0,0.4); border-radius: 14px; }
.arena-radar { position: relative; width: 90px; height: 90px; margin: 0 auto 10px; }
.arena-radar span { position: absolute; inset: 0; border: 2px solid #ffbf00; border-radius: 50%; opacity: 0; animation: arena-ping 2.1s ease-out infinite; }
.arena-radar span:nth-child(2) { animation-delay: .7s; }
.arena-radar span:nth-child(3) { animation-delay: 1.4s; }
@keyframes arena-ping { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.arena-searching-text { font-family: 'Dragon Slayer', serif; color: #ffbf00; font-size: 1.2rem; margin: 0; }
.arena-ellipsis::after { content: '…'; animation: arena-dots 1.5s steps(4) infinite; }
@keyframes arena-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.arena-searching-hint { color: rgba(240,236,230,0.6); font-size: 0.82rem; margin: 6px 0 14px; }
.arena-found { margin-top: 16px; text-align: center; color: #9be39b; font-family: 'Dragon Slayer', serif; font-size: 1.2rem; }

/* bench builder */
.arena-bench { margin-top: 18px; }
.arena-bench-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.arena-bench-head h3, .arena-reveal-head h2 { font-family: 'Dragon Slayer', serif; color: #ffbf00; margin: 0; font-size: 1.2rem; }
.arena-bench-hint { color: rgba(240,236,230,0.6); font-size: 0.82rem; margin: 4px 0 0; }
.arena-bench-ctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.arena-bench-count { font-family: 'HwyGothic', sans-serif; letter-spacing: 1px; color: #ffbf00; font-size: 0.85rem; }
.arena-bench-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ar-bench-card { position: relative; height: auto; /* override global button height */ padding: 0; border: 2px solid transparent; border-radius: 8px; background: #111; cursor: pointer; overflow: hidden; transition: transform .15s, opacity .15s; display: flex; flex-direction: column; }
.ar-bench-card img { width: 100%; display: block; aspect-ratio: 5 / 7; object-fit: cover; }
.ar-bench-name { font-family: 'HwyGothic', sans-serif; font-size: 0.62rem; letter-spacing: 1px; color: #f0ece6; padding: 4px; text-align: center; }
.ar-bench-card:hover { transform: translateY(-2px); border-color: rgba(255,191,0,0.6); }
.ar-bench-card.benched { opacity: 0.35; filter: grayscale(0.8); border-color: rgba(255,80,80,0.5); }
.ar-bench-card.benched::after { content: '\2715'; position: absolute; top: 6px; right: 6px; color: #ff6a6a; font-weight: 700; background: rgba(0,0,0,0.6); border-radius: 50%; width: 20px; height: 20px; line-height: 20px; text-align: center; font-size: 0.75rem; }

/* ── pack reveal ── */
.arena-reveal-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.arena-reveal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px 10px; }
.ar-card { perspective: 900px; cursor: pointer; }
.ar-card-inner { position: relative; aspect-ratio: 5 / 7; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.7,.2,1); border-radius: 8px; }
.ar-card.flipped .ar-card-inner { transform: rotateY(180deg); }
.ar-card-back, .ar-card-front { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 8px; overflow: hidden; }
.ar-card-back { background: radial-gradient(circle at 50% 35%, #3a1500 0%, #170800 60%, #0a0400 100%); border: 2px solid rgba(255,191,0,0.55); display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 30px rgba(255,120,0,0.35); }
.ar-card-back img { width: 70%; opacity: 0.9; }
.ar-card:not(.flipped):hover .ar-card-inner { transform: translateY(-4px) rotateY(0); box-shadow: 0 8px 20px rgba(255,191,0,0.25); }
.ar-card-front { transform: rotateY(180deg); background: #111; border: 2px solid rgba(255,255,255,0.12); }
.ar-card-front img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ar-card-name { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(0,0,0,0.85)); color: #f0ece6; font-family: 'HwyGothic', sans-serif; font-size: 0.62rem; letter-spacing: 1px; padding: 10px 4px 4px; text-align: center; }
.ar-card.flipped.has-skin .ar-card-front { border-color: var(--rar, #9fd8ff); box-shadow: 0 0 14px var(--rar, #9fd8ff); }
.ar-card.rarity-COMMON   { --rar: #b8c4cc; }
.ar-card.rarity-UNCOMMON { --rar: #5fd36a; }
.ar-card.rarity-RARE     { --rar: #ffd24d; }
.ar-card.rarity-EPIC     { --rar: #c177ff; }
.ar-card.rarity-ANCIENT  { --rar: #ff8c1a; }
.ar-card.pop .ar-card-inner { animation: ar-pop 1.1s ease-out; }
.ar-card.pop.rarity-EPIC .ar-card-inner, .ar-card.pop.rarity-ANCIENT .ar-card-inner { animation: ar-pop-big 1.2s ease-out; }
@keyframes ar-pop { 0% { transform: rotateY(180deg) scale(1); } 30% { transform: rotateY(180deg) scale(1.12); } 100% { transform: rotateY(180deg) scale(1); } }
@keyframes ar-pop-big { 0% { transform: rotateY(180deg) scale(1); } 25% { transform: rotateY(180deg) scale(1.3) translateY(-10px); } 60% { transform: rotateY(180deg) scale(1.15); } 100% { transform: rotateY(180deg) scale(1); } }
.ar-card.guaranteed .ar-card-back::after { content: '\2605'; position: absolute; top: 6px; right: 8px; color: #ffbf00; font-size: 0.9rem; text-shadow: 0 0 6px #ffbf00; }
.ar-skin { display: none; margin-top: 6px; border-radius: 8px; padding: 6px 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--rar, rgba(255,255,255,0.15)); font-size: 0.7rem; }
.ar-card.flipped .ar-skin { display: block; animation: ar-fade .5s ease-out; }
@keyframes ar-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ar-skin-tag { font-family: 'HwyGothic', sans-serif; letter-spacing: 1.5px; font-size: 0.6rem; color: var(--rar, #ffbf00); }
.ar-skin-name { color: #f0ece6; font-weight: 700; margin: 2px 0; }
.ar-skin-name small { display: block; color: rgba(240,236,230,0.55); font-weight: normal; }
.ar-skin-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: rgba(240,236,230,0.6); }
.ar-equip { height: auto; /* override global button height */ padding: 4px 8px; font-family: 'HwyGothic', sans-serif; letter-spacing: 1px; font-size: 0.6rem; background: #ffbf00; color: #0e0e0e; border: none; border-radius: 6px; cursor: pointer; }
.ar-equip.done { background: transparent; color: #9be39b; border: 1px solid #9be39b; cursor: default; }

/* ── ANCIENT DROP takeover ── */
.arena-ancient { position: fixed; inset: 0; z-index: 2000; background: radial-gradient(circle at 50% 40%, rgba(255,110,0,0.35), rgba(0,0,0,0.96) 65%); display: flex; align-items: center; justify-content: center; padding: 20px; animation: ar-fade .4s ease-out; --ar-accent: #ff8c1a; }
.arena-ancient-inner { text-align: center; max-width: 720px; }
.arena-ancient-title { font-family: 'Dragon Slayer', serif; font-size: clamp(2.6rem, 9vw, 6rem); color: var(--ar-accent); letter-spacing: 6px; text-shadow: 0 0 30px var(--ar-accent), 0 0 70px rgba(255,120,0,0.6); animation: ar-title 1s cubic-bezier(.2,1.4,.3,1); }
@keyframes ar-title { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
.arena-ancient-set { font-family: 'Dragon Slayer', serif; color: #ffbf00; font-size: clamp(1.3rem, 4vw, 2.2rem); letter-spacing: 3px; margin: 6px 0 16px; }
.arena-ancient-fan { display: flex; justify-content: center; margin: 0 0 14px; }
.arena-ancient-fan img { width: 110px; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 8px; border: 2px solid var(--ar-accent); box-shadow: 0 10px 30px rgba(0,0,0,0.7); margin: 0 -14px; transform-origin: 50% 120%; animation: ar-fan .8s ease-out both; }
.arena-ancient-fan img:nth-child(1) { transform: rotate(-24deg); } .arena-ancient-fan img:nth-child(2) { transform: rotate(-14deg); } .arena-ancient-fan img:nth-child(3) { transform: rotate(-5deg); }
.arena-ancient-fan img:nth-child(4) { transform: rotate(5deg); } .arena-ancient-fan img:nth-child(5) { transform: rotate(14deg); } .arena-ancient-fan img:nth-child(6) { transform: rotate(24deg); }
@keyframes ar-fan { from { opacity: 0; transform: translateY(40px) rotate(0); } }
.arena-ancient-text { color: #f0ece6; font-size: 1rem; margin: 0 0 8px; }
.arena-ancient .arena-actions { justify-content: center; }
body.arena-shake { animation: ar-shake .9s ease-in-out; }
@keyframes ar-shake { 10%, 90% { transform: translate(-2px, 0); } 20%, 80% { transform: translate(4px, 0); } 30%, 50%, 70% { transform: translate(-6px, 2px); } 40%, 60% { transform: translate(6px, -2px); } }

/* ── season / history ── */
.arena-season-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.arena-season-rule { color: rgba(240,236,230,0.8); margin: 10px 0 6px; }
.arena-season-mine { margin-bottom: 6px; }
.arena-history-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 0.88rem; }
.arena-history-date { color: rgba(240,236,230,0.5); font-size: 0.78rem; }
.arena-history-rec { color: #f0ece6; }
.arena-history-status { font-family: 'HwyGothic', sans-serif; letter-spacing: 1px; font-size: 0.7rem; color: #ffbf00; }

/* ── mobile ── */
@media ((max-width: 1024px) or (hover: none)) {
    .arena-shell { flex-direction: column; gap: 12px; }
    .arena-sidebar { position: static; height: auto; flex: none; padding: 10px; }
    .arena-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .arena-nav-group { display: contents; }
    .arena-nav-group-label { display: none; }
    .arena-tab { width: auto; padding: 8px 12px; border: 1px solid rgba(255,191,0,0.3); border-radius: 999px; }
    .arena-sidebar-foot { margin-top: 8px; display: flex; gap: 16px; border-top: none; padding: 0 4px; }
    .arena-enter { grid-template-columns: 1fr; }
    .arena-box-btn { max-width: 320px; margin: 0 auto; }
    .arena-reveal-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
    .arena-bench-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
    .arena-history-row { grid-template-columns: 1fr auto; }
    .arena-history-date { grid-column: 1 / -1; }
}
