/* ===== «Своя арена» — блоки нарисованы CSS, своя пиксельная эстетика в цветах темы «Лига» ===== */

/* кнопка тренера в шапке (бывшая вкладка) */
.nav-btn.hdr-chat {
  flex: 0 0 auto; font-size: 18px; padding: 6px 10px; margin-left: 6px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; color: var(--text);
  flex-direction: row; gap: 6px;
}
.nav-btn.hdr-chat span { font-size: 12px; }
.nav-btn.hdr-chat.active { border-color: var(--red); }
.nav-btn.hdr-chat.active::before { display: none; }
#nav .nav-btn span { font-size: 11.5px; letter-spacing: .06em; }

/* плитки мини-игр на «Матче дня» */
.mini-tile {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 8px;
  padding: 13px 14px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
}
.mini-tile:active { background: var(--surface-2); }
.mini-tile .mt-ico {
  font-size: 24px; width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px;
}
.mini-tile b { display: block; font-family: var(--display); font-weight: 600; font-size: 18px; text-transform: uppercase; letter-spacing: .05em; }
.mini-tile span { display: block; font-size: 14px; color: var(--silver-hi); line-height: 1.35; }

/* ===== Экран арены: шапка и панель не прокручиваются, поле — в своей прокрутке ===== */
#arena-area.scroll-area {
  display: flex; flex-direction: column; overflow: hidden; padding: 8px 12px 6px; gap: 8px;
}
.arena-head { display: flex; gap: 8px; align-items: stretch; flex: none; }
.arena-picks {
  flex: none; min-width: 76px; text-align: center; padding: 6px 8px;
  background: var(--surface); border: 1.5px solid var(--gold); border-radius: 4px;
  display: flex; flex-direction: column; justify-content: center;
}
.arena-picks b { display: block; font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--gold); }
.arena-picks span { font-size: 12px; color: var(--silver-hi); }
.arena-picks.empty { border-color: var(--red); }
.arena-picks.empty b { color: #ff6b82; }
.arena-picks.shake { animation: shake-x .3s ease-in-out; }

.quest {
  flex: 1; min-width: 0; padding: 7px 10px; border-radius: 4px;
  background: linear-gradient(90deg, rgba(216, 180, 90, .18), rgba(216, 180, 90, .05));
  border: 1.5px solid rgba(216, 180, 90, .7);
}
.q-top { display: flex; justify-content: space-between; align-items: baseline; }
.q-top b { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--gold); }
.q-prize { font-family: var(--display); font-weight: 600; color: var(--gold); font-size: 14px; }
.q-text { display: block; font-size: 15px; line-height: 1.25; margin: 2px 0 5px; }
.q-bar { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.q-bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; transition: width .4s ease-out; }
.arena-help {
  flex: none; width: 34px; font-family: var(--display); font-weight: 700; font-size: 18px;
  color: var(--silver-hi); background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
}

.arena-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line); border-radius: 4px; background: #07080a;
}
.arena-grid { display: grid; grid-template-columns: repeat(var(--w), 1fr); touch-action: manipulation; }

.arena-foot { flex: none; }
.arena-foot .earn { margin: 0 0 6px; padding: 13px; font-size: 17px; }
.arena-hint { font-size: 14.5px; color: var(--text); margin: 0 2px 6px; line-height: 1.35; min-height: 20px; }
.inv-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; min-height: 28px; align-items: center; }
.inv { display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; }
.inv .blk { width: 20px; height: 20px; }
.inv b { font-family: var(--display); font-weight: 600; font-size: 16px; }
.inv.bump { animation: bump .35s cubic-bezier(.3, 1.6, .5, 1); }
.inv-empty { font-size: 14px; color: var(--silver); }

/* ---------- клетки ---------- */
.cell {
  aspect-ratio: 1; padding: 0; border: 0; margin: 0; background: transparent;
  position: relative; cursor: pointer; display: block;
}
.cell.sky { background: linear-gradient(180deg, #1a2230, #222c3b); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .03); }
.cell.cave { background: #0a0b0d; box-shadow: inset 0 0 0 .5px #15181d; }
.cell.ground { box-shadow: inset 0 2px 0 rgba(120, 200, 255, .5); }
.cell .blk { position: absolute; inset: 0; width: 100%; height: 100%; }

/* можно копать — пульсирующая рамка; нельзя — блок притушен */
.cell.can::after {
  content: ''; position: absolute; inset: 1px; border-radius: 2px; pointer-events: none;
  border: 2px solid #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .7), 0 0 6px rgba(255, 255, 255, .7);
  animation: pulse 1.4s ease-in-out infinite;
}
.cell.nope .blk { filter: brightness(.55) saturate(.7); }
/* куда строить: пунктир чертежа — золотой, просто свободно — тонкая сетка */
.cell.drop::after { content: ''; position: absolute; inset: 2px; border: 1px dashed rgba(255, 255, 255, .16); border-radius: 2px; pointer-events: none; }
.cell.ghost::after {
  content: ''; position: absolute; inset: 1px; border: 2px dashed var(--gold); border-radius: 2px; pointer-events: none;
  animation: pulse 1.4s ease-in-out infinite;
}
.ghost-blk { position: absolute; inset: 3px; opacity: .35; }
.ghost-blk .blk { position: absolute; inset: 0; width: 100%; height: 100%; }
/* туман глубины: порода скрыта, ценное блестит искрой */
.cell.fog { background: #101216; box-shadow: inset 0 0 0 .5px #1a1d22; }
.cell.fog.glint::before {
  content: ''; position: absolute; left: 42%; top: 42%; width: 16%; height: 16%; border-radius: 50%;
  background: #fff2b0; box-shadow: 0 0 6px 2px rgba(255, 220, 120, .55); animation: pulse 2.2s ease-in-out infinite;
}
.cell.pop .blk { animation: pop .22s cubic-bezier(.3, 1.5, .5, 1); }

/* ---------- блоки: у каждого своя форма, не только цвет ---------- */
.blk { display: block; border-radius: 2px; position: relative; box-shadow: inset 1px 1px 0 rgba(255,255,255,.18), inset -1px -1px 0 rgba(0,0,0,.35); }
.b-snow  { background: radial-gradient(circle at 25% 65%, #fff 0 8%, transparent 9%), radial-gradient(circle at 70% 75%, #fff 0 7%, transparent 8%), linear-gradient(180deg, #fbfdff 0 42%, #cfdbe4 42% 100%); }
.b-stone { background: radial-gradient(circle at 30% 30%, #626a74 0 14%, transparent 15%), radial-gradient(circle at 72% 66%, #3f454d 0 15%, transparent 16%), #4f565f; }
.b-ice   { background: linear-gradient(135deg, transparent 0 30%, rgba(255,255,255,.75) 30% 38%, transparent 38%), linear-gradient(180deg, #bfe8fc, #7fc6ee); box-shadow: inset 0 0 0 1.5px #d8f2ff; }
.b-iron  { background: repeating-linear-gradient(135deg, #a9bccf 0 2px, transparent 2px 7px), #56667a; }
.b-gold  { background: radial-gradient(circle at 28% 30%, #fff1b0 0 15%, #e8b923 16% 23%, transparent 24%), radial-gradient(circle at 70% 64%, #fff1b0 0 13%, #e8b923 14% 21%, transparent 22%), #6b5a3a; box-shadow: inset 0 0 6px rgba(255, 200, 60, .45); }
.b-puck  { background: radial-gradient(ellipse 50% 36% at 50% 55%, #0b0b0b 0 88%, #3a3a3a 89% 100%, transparent 101%), radial-gradient(ellipse 30% 8% at 46% 40%, rgba(255,255,255,.6) 0 90%, transparent 100%), #4a525c; }
.b-base  { background: repeating-linear-gradient(90deg, #3a4048 0 9px, #30353c 9px 10px), #3a4048; box-shadow: inset 0 2px 0 #6c7682; }

.b-rink  { background: linear-gradient(180deg, #ffffff 0 62%, #8fd0f2 62%); box-shadow: inset 0 -2px 0 #3f9fd8; }
.b-board { background: linear-gradient(180deg, #f5f7f8 0 60%, #e4002b 60% 82%, #f5f7f8 82%); }
.b-glass { background: linear-gradient(135deg, rgba(200,235,255,.35), rgba(200,235,255,.1)); box-shadow: inset 0 0 0 1.5px rgba(220,240,255,.8); }
.b-seat  { background: linear-gradient(180deg, #e4002b 0 45%, #8f001b 45% 62%, #2e343c 62%); }
.b-net   { background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.75) 3px 4px), repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,.75) 3px 4px), #1c2026; box-shadow: inset 0 0 0 2.5px #e4002b; }
.b-lamp  { background: radial-gradient(circle at 50% 55%, #fff6c8 0 28%, #ffd34d 29% 40%, #2e343c 41%); }
.b-flag  { background: linear-gradient(90deg, #a8b0b5 0 12%, transparent 12%), linear-gradient(180deg, #e4002b 0 30%, #f5f7f8 30% 50%, transparent 50%); }
.b-cup   { background: radial-gradient(ellipse 30% 22% at 50% 30%, #f1d37f 0 95%, transparent 100%), linear-gradient(90deg, transparent 42%, #d8b45a 42% 58%, transparent 58%), linear-gradient(180deg, transparent 75%, #8a6d22 75% 90%, transparent 90%); }
.blk.statue {
  display: grid; place-items: center; background: linear-gradient(180deg, #d9dee2, #8e979d);
  color: #111; font-family: var(--display); font-weight: 700; font-size: 11px;
}
.blk.statue.epic { background: linear-gradient(180deg, #bfe6ff, #3f8fc4); }
.blk.statue.legend { background: linear-gradient(180deg, #ffe7a3, #b8913a); }

/* ---------- панель инструментов ---------- */
.hotbar {
  display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, #000 88%, transparent); /* видно, что панель уходит вправо */
}
.hotbar::-webkit-scrollbar { display: none; }
.tool {
  flex: 0 0 70px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 3px 6px; font: inherit; color: var(--text); cursor: pointer; position: relative;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 4px;
  transition: transform .12s ease-out;
}
.tool .blk { width: 28px; height: 28px; }
.tool .t-icon { font-size: 22px; line-height: 28px; }
.tool .t-name { font-size: 12px; line-height: 1.1; text-align: center; color: var(--silver-hi); }
.tool .t-cost { display: flex; gap: 3px; }
.cost { display: inline-flex; align-items: center; gap: 1px; font-size: 11px; font-weight: 700; color: var(--silver-hi); }
.cost .blk { width: 11px; height: 11px; box-shadow: none; }
.cost.lack { color: #ff6b82; }
.tool.on { border: 2px solid var(--gold); background: rgba(216, 180, 90, .16); transform: translateY(-3px); }
.tool.on .t-name { color: var(--text); font-weight: 700; }
.tool.poor .blk, .tool.poor .t-name { opacity: .6; }
.tool.shake { animation: shake-x .3s ease-in-out; }

/* ---------- всплывашка ---------- */
#arena-toast {
  position: fixed; left: 50%; top: calc(120px + env(safe-area-inset-top)); transform: translate(-50%, -10px);
  background: var(--surface-2); color: var(--text); border: 1px solid var(--gold); border-radius: 4px;
  padding: 10px 16px; font-weight: 700; font-size: 15px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 80; max-width: 88vw; text-align: center;
}
#arena-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* осколки при добыче */
.chip-fx {
  position: fixed; width: 6px; height: 6px; border-radius: 1px; z-index: 75; pointer-events: none;
  animation: chip .45s cubic-bezier(.2, .7, .4, 1) forwards;
}

/* ---------- фанфары задания ---------- */
.quest-card .qm-wolf { width: 120px; height: 120px; object-fit: contain; margin: -6px auto 0; display: block; }
.quest-card h3 { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 26px; }
.qm-prize { font-family: var(--display); font-weight: 700; font-size: 44px; color: var(--gold); margin: 6px 0; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.qm-next { font-size: 15px; color: var(--silver-hi); background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 10px; margin-top: 8px; }
.qm-next b { color: var(--gold); }

/* ---------- обучение ---------- */
#arena-tour { position: fixed; inset: 0; z-index: 70; }
.tour-hole {
  position: fixed; border-radius: 6px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .68), 0 0 0 2px var(--gold);
  transition: left .25s ease-out, top .25s ease-out, width .25s, height .25s;
}
.tour-hand {
  position: fixed; font-size: 34px; pointer-events: none; transform: translate(-30%, 10%);
  animation: tap 1.1s ease-in-out infinite; filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
}
.tour-say {
  position: fixed; left: 12px; right: 12px; display: flex; gap: 10px; align-items: center;
  background: var(--surface-2); border: 1.5px solid var(--gold); border-radius: 6px; padding: 10px 12px;
}
.tour-say.bottom { bottom: calc(86px + env(safe-area-inset-bottom)); }
.tour-say.top { top: calc(70px + env(safe-area-inset-top)); }
.tour-say img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.tour-say p { font-family: var(--display); font-weight: 500; font-size: 18px; line-height: 1.25; letter-spacing: .01em; }
.tour-btns { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.tour-btns .btn { margin: 0; padding: 10px 16px; width: auto; font-size: 15px; }
.tour-skip { font: inherit; font-size: 13px; color: var(--silver); background: none; border: 0; text-decoration: underline; padding: 6px; }

@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bump { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.25); } }
@keyframes shake-x { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes chip { to { transform: translate(var(--dx), var(--dy)) rotate(160deg); opacity: 0; } }
@keyframes tap { 0%, 100% { transform: translate(-30%, 10%) scale(1); } 50% { transform: translate(-30%, -4px) scale(.9); } }
@media (prefers-reduced-motion: reduce) {
  .cell.can::after, .cell.ghost::after, .cell.fog.glint::before, .tour-hand, .cell.pop .blk, .inv.bump, .qm-prize { animation: none; }
}

/* шапка: числа в одну строку, статус «на связи» прячем — места мало, а пользы нет (аудит) */
header { gap: 8px; }
header > div:nth-child(2) { min-width: 0; flex: 1; }
h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#status { display: none; }
.header-stats { flex-shrink: 0; }
.hchip { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 5px 8px; }
@media (max-width: 400px) { .nav-btn.hdr-chat span { display: none; } }
