/* Ranglisten-Arena (client/arena.js) – Messingtafel, Rangschilde, Rangliste */
.ar { --ar-ink: #ebe1cc; --ar-dim: rgba(235,225,204,0.66); --ar-brass: #e2b45a; --ar-ally: #5fd4c4; --ar-foe: #ef6a4f; color: var(--ar-ink); }
.ar-empty { color: var(--ar-dim); font-style: italic; padding: 8px 0; }
.ar-modes { display: inline-flex; gap: 2px; padding: 3px; margin: 0 0 12px; border-radius: 999px; background: rgba(3,10,16,0.65); border: 1px solid rgba(226,180,90,0.3); }
.ar-mode { padding: 6px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--ar-dim); font: 600 14px Georgia, serif; cursor: pointer; }
.ar-mode.on { background: linear-gradient(180deg, #f2c464, #c9922f); color: #1c1208; }
.ar-mode:focus-visible, .ar-btn:focus-visible { outline: 2px solid #fff3dc; outline-offset: 2px; }

/* Rangtafel */
.ar-plaque {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px 18px; border-radius: 12px; margin: 0 0 12px;
  background: radial-gradient(140% 120% at 0% 0%, rgba(255,255,255,0.07), rgba(255,255,255,0) 55%), linear-gradient(160deg, #1b2733, #0d151d);
  border: 1px solid rgba(226,180,90,0.45); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 8px 22px rgba(0,0,0,0.35);
}
.ar-plaque.tier-gold { border-color: rgba(240,195,90,0.7); }
.ar-plaque.tier-platinum { border-color: rgba(143,214,204,0.7); }
.ar-plaque.tier-diamond { border-color: rgba(111,184,255,0.75); }
.ar-plaque.tier-admiral { border-color: #f2c55c; background: radial-gradient(140% 120% at 0% 0%, rgba(242,197,92,0.14), rgba(242,197,92,0) 55%), linear-gradient(160deg, #18213f, #070b18); }
.ar-emblem { width: 96px; height: 96px; }
.ar-rank h3 { margin: 0; font: 700 24px 'Cinzel', Georgia, serif; letter-spacing: 0.5px; color: #fff3dc; }
.ar-rating { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 6px; }
.ar-rating b { font-size: 30px; font-variant-numeric: tabular-nums; color: var(--ar-brass); line-height: 1; }
.ar-rating span { font-size: 13px; color: var(--ar-dim); }
.ar-rating .ar-pos { padding: 1px 8px; border-radius: 999px; background: rgba(226,180,90,0.16); color: var(--ar-brass); font-weight: 700; }
.ar-bar { height: 7px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; max-width: 320px; }
.ar-bar i { display: block; height: 100%; background: linear-gradient(90deg, #c9922f, #f6d27a); }
.ar-sub { margin: 5px 0 0; font-size: 13px; color: var(--ar-dim); }
.ar-record { margin: 4px 0 0; font-size: 13px; color: var(--ar-ink); font-variant-numeric: tabular-nums; }
.ar-season { text-align: right; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--ar-dim); }
.ar-season b { font-size: 18px; color: #fff3dc; white-space: nowrap; }

/* Warteschlange */
.ar-queue { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; }
.ar-queue small { color: var(--ar-dim); font-size: 13px; }
.ar-btn { padding: 11px 22px; border-radius: 8px; border: 0; cursor: pointer; font: 700 15px Georgia, serif; background: linear-gradient(180deg, #f2c464, #c9922f); color: #1c1208; box-shadow: 0 3px 0 #7a5418, 0 6px 14px rgba(0,0,0,0.35); }
.ar-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a5418; }
.ar-btn:disabled { opacity: 0.5; cursor: default; }
.ar-btn.ghost { background: transparent; color: var(--ar-ink); border: 1px solid rgba(235,225,204,0.35); box-shadow: none; padding: 8px 16px; }
.ar-queue.searching, .ar-queue.found { padding: 10px 14px; border-radius: 10px; background: rgba(5,12,18,0.6); border: 1px solid rgba(226,180,90,0.35); }
.ar-queue.searching > div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ar-queue.found { flex-direction: column; align-items: flex-start; gap: 2px; border-color: var(--ar-ally); }
.ar-queue.found span { color: var(--ar-dim); font-size: 13px; }
.ar-wait { font-size: 20px; font-variant-numeric: tabular-nums; color: var(--ar-brass); }
.ar-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(226,180,90,0.25); border-top-color: var(--ar-brass); animation: ar-spin 1s linear infinite; }
@keyframes ar-spin { to { transform: rotate(360deg); } }
.ar-note, .ar-rules { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--ar-dim); max-width: 72ch; }

/* Spalten */
.ar-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.ar h4 { margin: 0 0 8px; font: 700 16px 'Cinzel', Georgia, serif; color: #fff3dc; }
.ar h4 em { font: 400 13px Georgia, serif; color: var(--ar-dim); margin-left: 6px; font-style: normal; }
.ar h5 { margin: 14px 0 6px; font-size: 14px; color: #fff3dc; }
.ar-fine { margin: 0 0 8px; font-size: 12px; color: var(--ar-dim); }
.ar-ladder ol { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; border-radius: 8px; background: rgba(3,10,16,0.45); }
.ar-ladder li { display: grid; grid-template-columns: 30px 24px minmax(0, 1fr) auto 56px; gap: 8px; align-items: center; padding: 6px 10px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.ar-ladder li:nth-child(-n+3) .ar-n { color: var(--ar-brass); font-weight: 700; }
.ar-ladder li.me { background: rgba(95,212,196,0.12); box-shadow: inset 3px 0 0 var(--ar-ally); }
.ar-ladder li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ar-ladder img { width: 22px; height: 22px; }
.ar-n { text-align: right; color: var(--ar-dim); font-variant-numeric: tabular-nums; }
.ar-wl { font-size: 12px; color: var(--ar-dim); font-variant-numeric: tabular-nums; }
.ar-r { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ar-brass); }
.ar-tiers, .ar-top, .ar-match, .ar-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ar-tiers li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 8px; border-radius: 6px; }
.ar-tiers li.on { background: rgba(226,180,90,0.14); box-shadow: inset 0 0 0 1px rgba(226,180,90,0.45); }
.ar-tiers img { width: 30px; height: 30px; }
.ar-tiers li > span:nth-child(2) { display: flex; flex-direction: column; font-size: 13px; }
.ar-tiers small { color: var(--ar-dim); font-size: 11px; }
.ar-chips { display: inline-flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ar-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ar-chip img { width: 15px; height: 15px; }
.ar-top li, .ar-match li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 8px; font-size: 13px; }
.ar-match li { grid-template-columns: minmax(0, 1fr) auto; }
.ar-place { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #1c1208; }
.ar-place.p1 { background: linear-gradient(180deg, #fff1b0, #d9a43a); }
.ar-place.p2 { background: linear-gradient(180deg, #ffffff, #9aa5b0); }
.ar-place.p3 { background: linear-gradient(180deg, #f0b483, #9a5a2c); }
.ar-title { font-style: italic; color: var(--ar-ink); }
.ar-hist li { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 8px; font-size: 13px; border-radius: 6px; background: rgba(255,255,255,0.03); }
.ar-hist .ar-vs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ar-dim); }
.ar-hist li.win .ar-res { color: var(--ar-ally); font-weight: 700; }
.ar-hist li.loss .ar-res { color: var(--ar-foe); font-weight: 700; }
.ar-d { font-variant-numeric: tabular-nums; font-weight: 700; }
.ar-d.up { color: var(--ar-ally); }
.ar-d.down { color: var(--ar-foe); }
.ar .ar-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 9800; max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 8px; font-size: 14px;
  background: rgba(60,20,14,0.97); border: 1px solid rgba(255,140,120,0.5); color: #ffd9cf; box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  opacity: 0; transform: translate(-50%, 8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.ar .ar-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 720px) {
  .ar-cols { grid-template-columns: 1fr; }
  .ar-plaque { grid-template-columns: auto minmax(0, 1fr); }
  .ar-season { grid-column: 1 / -1; text-align: left; flex-direction: row; gap: 8px; align-items: baseline; }
  .ar-emblem { width: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) { .ar-spin { animation-duration: 3s; } .ar .ar-toast { transition: none; } }

#arena-panel { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); width: min(calc(100vw - 16px), 900px); z-index: 7; pointer-events: auto; }
#arena-panel.hidden { display: none; }
#arena-panel .admin-card { width: 100%; max-height: calc(100vh - 80px); display: flex; flex-direction: column; }
#arena-body { overflow-y: auto; padding: 4px 2px 6px; }

/* ---------- Im Match: Anzeige oben, Countdown, Ergebnis, Suche ---------- */
#arena-hud { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 6; display: flex; align-items: stretch; gap: 10px; pointer-events: none; font-family: Georgia, serif; }
#arena-hud.hidden { display: none; }
.ah-team { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.ah-team.foe { align-items: flex-end; }
.ah-ship { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; width: 170px; padding: 4px 8px; border-radius: 6px; background: rgba(4,10,16,0.78); border: 1px solid rgba(95,212,196,0.45); color: #e9fbf8; font-size: 12px; }
.ah-team.foe .ah-ship { border-color: rgba(239,106,79,0.5); color: #ffe6df; }
.ah-ship.out { opacity: 0.45; }
.ah-ship .ah-name { display: flex; justify-content: space-between; gap: 6px; white-space: nowrap; overflow: hidden; }
.ah-ship .ah-name b { overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ah-ship .ah-hp { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.1); overflow: hidden; }
.ah-ship .ah-hp i { display: block; height: 100%; background: linear-gradient(90deg, #2fa797, #6ee6d4); transition: width .25s; }
.ah-team.foe .ah-hp i { background: linear-gradient(90deg, #b8392a, #f07a5e); }
.ah-mid { min-width: 96px; padding: 4px 12px; border-radius: 8px; text-align: center; background: rgba(4,10,16,0.85); border: 1px solid rgba(226,180,90,0.55); color: #fff3dc; display: flex; flex-direction: column; justify-content: center; }
.ah-mid b { font-size: 22px; font-variant-numeric: tabular-nums; color: #e2b45a; line-height: 1.1; }
.ah-mid small { font-size: 11px; color: rgba(235,225,204,0.7); }
.ah-mid.ring b { color: #ff8a6a; }
#arena-countdown { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 6; }
#arena-countdown.hidden { display: none; }
#arena-countdown span { font: 700 120px 'Cinzel', Georgia, serif; color: #f6d27a; text-shadow: 0 6px 30px rgba(0,0,0,0.75), 0 0 2px #3a2208; }
#arena-countdown span.go { color: #fff3dc; }
#arena-result { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(calc(100vw - 24px), 520px); z-index: 9; pointer-events: auto; }
#arena-result.hidden { display: none; }
.arr-card { padding: 20px 22px 18px; border-radius: 14px; text-align: center; color: #ebe1cc; background: linear-gradient(160deg, #1b2733, #0a1118); border: 1px solid rgba(226,180,90,0.55); box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.arr-card h2 { margin: 0; font: 700 34px 'Cinzel', Georgia, serif; letter-spacing: 1px; }
.arr-card.win h2 { color: #f6d27a; }
.arr-card.loss h2 { color: #ef6a4f; }
.arr-card.draw h2 { color: #cfd7de; }
.arr-rating { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 10px 0 6px; }
.arr-rating img { width: 64px; height: 64px; }
.arr-rating b { font-size: 30px; font-variant-numeric: tabular-nums; }
.arr-delta { font-size: 18px; font-weight: 700; }
.arr-delta.up { color: #5fd4c4; }
.arr-delta.down { color: #ef6a4f; }
.arr-promo { margin: 4px 0 8px; font: 700 16px 'Cinzel', Georgia, serif; color: #f6d27a; }
.arr-note { margin: 4px 0; font-size: 13px; color: rgba(235,225,204,0.7); }
.arr-table { width: 100%; margin: 12px 0 8px; border-collapse: collapse; font-size: 13px; }
.arr-table th { font-weight: 400; color: rgba(235,225,204,0.6); text-align: right; padding: 3px 6px; }
.arr-table th:first-child, .arr-table td:first-child { text-align: left; }
.arr-table td { padding: 4px 6px; text-align: right; font-variant-numeric: tabular-nums; border-top: 1px solid rgba(255,255,255,0.05); }
.arr-table tr.ally td:first-child { box-shadow: inset 3px 0 0 #5fd4c4; }
.arr-table tr.foe td:first-child { box-shadow: inset 3px 0 0 #ef6a4f; }
.arr-table tr.me td { font-weight: 700; color: #fff3dc; }
.arr-rewards { display: flex; justify-content: center; gap: 14px; margin: 6px 0 10px; font-size: 15px; }
.arr-rewards span { display: inline-flex; align-items: center; gap: 4px; }
.arr-rewards img { width: 18px; height: 18px; }
.arr-actions { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
#arena-search { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 12px; border-radius: 999px; background: rgba(4,10,16,0.85); border: 1px solid rgba(226,180,90,0.5); color: #ebe1cc; font-size: 13px; pointer-events: auto; }
#arena-search.hidden { display: none; }
#arena-search.found { border-color: #5fd4c4; }
#arena-search b { color: #e2b45a; font-variant-numeric: tabular-nums; }
#arena-search button { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(235,225,204,0.35); background: transparent; color: inherit; cursor: pointer; font: inherit; }
@media (max-width: 640px) {
  .ah-ship { width: 112px; font-size: 11px; }
  .ah-team { min-width: 0; }
  #arena-countdown span { font-size: 80px; }
}
