/* =========================================================
   Changelog Panel — STANDARDIZED (Matches Journal / Logs)
   ========================================================= */

/* Panel shell */
#changelog-panel {
  background: rgba(13, 27, 42, 0.95);
  border: 2px solid #415a77;
  border-radius: 12px;

  color: #ffffff;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
}

/* ============================
   Header
   ============================ */

#changelog-panel .panel-header {
  flex-shrink: 0;
}

#changelog-panel .panel-header {
  padding: 8px 12px;
  font-size: 18px;
  font-weight: bold;
  color: #ffd60a;
  text-align: center;
  text-shadow: 2px 2px 0 #000;
  border-bottom: 1px solid #415a77;
}

#changelog-panel .panel-title {
  flex: 1;
  text-align: center;
}

#changelog-panel .panel-header-controls {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* ============================
   Content Wrapper
   ============================ */

#changelog-panel .panel-body {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#changelog-panel .panel-content {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

/* ============================
   Split Layout
   ============================ */

.changelog-split {
  display: flex;
  width: 100%;
  height: 100%;
}

/* ============================
   Left Column — Version List (1/3)
   ============================ */

.changelog-left {
  width: 33%;
  padding: 8px;
  overflow-y: auto;

  border-right: 1px solid rgba(255, 255, 255, 0.15);
  box-sizing: border-box;
}

/* Version entries */
.changelog-version-item {
  padding: 6px 8px;
  margin-bottom: 4px;

  border-radius: 6px;
  cursor: pointer;

  font-size: 13px;
}

.changelog-version-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.changelog-version-item.active {
  background: rgba(255, 255, 255, 0.16);
}

/* Label + date */
.version-label {
  font-weight: bold;
  color: #ffffff;
}

.version-date {
  font-size: 11px;
  opacity: 0.7;
}

/* CURRENT badge — uses global gold */
.changelog-current-tag {
  margin-left: 6px;
  padding: 1px 5px;

  font-size: 10px;
  font-weight: bold;

  border-radius: 4px;
  background: #ffd60a;
  color: #000000;
}

/* ============================
   Right Column — Detail View (2/3)
   ============================ */

.changelog-right {
  width: 67%;
  padding: 10px;
  overflow-y: auto;

  box-sizing: border-box;
}

/* Detail header */
.changelog-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;

  margin-bottom: 8px;
}

.changelog-detail-header h2 {
  margin: 0;
  font-size: 18px;
  color: #ffd60a;
}

.changelog-detail-date {
  font-size: 12px;
  opacity: 0.7;
}

/* Notes list */
.changelog-detail-notes {
  padding-left: 18px;
  margin: 0;

  font-size: 13px;
  line-height: 1.5;
}

.changelog-detail-notes li {
  margin-bottom: 4px;
}

/* Icons */
.help-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 6px;
}


/* === moved from 03-panel-contract.css in pass25: music-player-hud === */
/* ============================
   MUSIC PLAYER HUD
   ============================ */
#music-player-hud {
  width: 606px;
  height: 252px;
  min-width: 0;
  min-height: 0;
}

#music-player-hud > .panel-body {
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
  padding: 0;
  background: #2e2460;
}

#musicplayer-bg {
  display: block;
  width: 100%;
  height: calc(100% - 2px);
  object-fit: fill;
  pointer-events: none;
}

#musicplayer-track-title {
  position: absolute;
  left: 32px;
  top: 22px;
  width: 542px;
  height: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  box-sizing: border-box;
  color: #f4f6ff;
  font-weight: 800;
  font-size: 28px;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0,0,0,0.65);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#musicplayer-controls {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 16px;
  height: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 0.85fr 2.35fr;
  gap: 8px;
  align-items: stretch;
}

#musicplayer-controls .music-btn,
#musicplayer-volume-wrap {
  position: relative;
  z-index: 2;
}

#musicplayer-controls .music-btn {
  border: 0;
  background: transparent;
  color: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 8px;
}

#musicplayer-controls .music-btn:focus-visible,
#musicplayer-volume-wrap:focus-within {
  outline: 2px solid rgba(255,255,255,0.9);
  outline-offset: -3px;
}

#musicplayer-volume-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

#music-volume {
  width: calc(100% - 20px);
  margin: 0;
}

#music-tracklist-footer .music-btn {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.music-track-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
}

.music-track-name {
  flex: 1;
  min-width: 0;
}

.music-tracklist-empty {
  color: rgba(255,255,255,0.75);
}


/* moved from 03-panel-contract.css in pass26: utility/tutorial ownership */

/* ============================
   Paper Doll Panel
   ============================ */


/* ============================
   Chao Preview
   ============================ */


/* ============================
   Equip Slots
   ============================ */


/* Slot base */


/* Empty state */


/* Drag highlight */


/* Slot label (STATIC — never removed) */


/* Equipped item icon — sprite-sheet safe */


/* Optional hover polish */


/* ============================
   Inventory Grid Container
   ============================ */


/* ============================
   Global Log Panel (Expanded)
   ============================ */
#global-log-panel {
  width: 700px;
  height: 550px;
  background: rgba(13, 27, 42, 0.9);
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1500 !important;
}

#global-log-panel .panel-title {
  color: #ffd60a;
}

.log-panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
}

.log-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.log-tabs button {
  padding: 4px 8px;
  background: #415a77;
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  transition: background 0.2s;
}

.log-tabs button.active {
  background: #ffd60a;
  color: #000;
}

#global-log-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: rgba(0,0,0,0.4);
  border: 1px solid #415a77;
  border-radius: 6px;
  padding: 6px;
  font-size: 13px;
  line-height: 1.3em;
  font-family: monospace;
}

#clear-global-log {
  background: #415a77;
  border: 2px solid #ffd60a;
  border-radius: 6px;
  color: #fff;
  padding: 4px 10px;
  font-weight: bold;
  margin-top: 8px;
}

#clear-global-log:hover {
  background: #5b63ff;
}

/* ============================
   Mini-Game Log Panel (Mirror of Global, scroll fixed)
   ============================ */


.xp-popup {
  font-family: "Arial", sans-serif;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px #000;
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
  animation: xpFloat 1.6s ease-out forwards;
}

.xp-popup.swim { color: #00ff88; }
.xp-popup.fly { color: #33ccff; }
.xp-popup.run { color: #ffd600; }
.xp-popup.power { color: #ff5555; }
.xp-popup.stamina { color: #bb66ff; }

@keyframes xpFloat {
  0%   { opacity: 0; transform: translate(-50%, 20px); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -40px); }
}

/* =========================================================
   Tutorial Intro Panel — STANDARDIZED (Matches Journal/Logs)
   ========================================================= */

#tutorial-intro-panel {
  z-index: 160 !important;
}

#tutorial-intro-panel.visible {
  display: flex;
}

/* Header */
#tutorial-intro-panel .panel-header {
  padding: 8px 12px;
  font-size: 18px;
  font-weight: bold;
  color: #ffd60a;
  text-align: center;
  text-shadow: 2px 2px 0 #000;
  border-bottom: 1px solid #415a77;
  flex-shrink: 0;
}

/* Content */
#tutorial-intro-panel .panel-content {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.95;
  overflow-y: auto;
  box-sizing: border-box;
}

/* Title inside content */
#tutorial-intro-panel .panel-content h2 {
  margin: 4px 0 10px;
  font-size: 16px;
  font-weight: bold;
  color: #ffffff;
}

/* Footer actions */
#tutorial-intro-panel .panel-footer {
  padding: 10px 12px;
  border-top: 1px solid #415a77;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* Buttons — project standard */
#tutorial-intro-panel button {
  min-width: 130px;
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: bold;

  background: #1b263b;
  border: 2px solid #415a77;
  color: #fff;
  cursor: pointer;

  pointer-events: auto !important;
}

#tutorial-intro-panel button:hover {
  background: #415a77;
}

#tutorial-intro-panel .primary {
  border-color: #ffd60a;
}

#tutorial-intro-panel .primary:hover {
  background: #5b63ff;
}

/* =========================================================
   Tutorial Pages Panel — Anchor Footer (STANDARD, FIXED)
   ========================================================= */

#tutorial-pages-panel {
  width: 1400px;
  height: 800px;
  max-width: min(1400px, calc(var(--app-authored-width) - 24px));
  max-height: min(800px, calc(var(--app-authored-height) - 24px));
  min-width: 0;
  min-height: 0;
  z-index: 160 !important;
}

#tutorial-pages-panel > .panel-body {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* =========================
   Header (fixed height)
   ========================= */

#tutorial-pages-panel .panel-header {
  padding: 8px 12px;
  font-size: 18px;
  font-weight: bold;
  color: #ffd60a;
  text-align: center;
  text-shadow: 2px 2px 0 #000;
  border-bottom: 1px solid #415a77;

  flex-shrink: 0;
}

/* =========================
   Content (scrollable)
   ========================= */

#tutorial-pages-panel .panel-content {
  padding: 14px;
  box-sizing: border-box;
}

/* 🔑 CRITICAL FIX:
   Prevent page body from acting like a flex spacer */
#tutorial-page-body {
  display: block;
  width: 100%;
}

/* =========================
   Footer (HARD-PINNED)
   ========================= */

.tutorial-pages-footer {
  padding: 10px 12px;
  border-top: 1px solid #415a77;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;

  /* 🔑 HARD REQUIREMENT */
  flex-shrink: 0;
}

/* Buttons — project standard */
.tutorial-pages-footer button {
  min-width: 130px;
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: bold;

  background: #1b263b;
  border: 2px solid #415a77;
  color: #fff;
  cursor: pointer;
}

.tutorial-pages-footer button:hover {
  background: #415a77;
}

.tutorial-pages-footer .primary {
  border-color: #ffd60a;
}

.tutorial-pages-footer .primary:hover {
  background: #5b63ff;
}

.tutorial-pages-footer button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* =========================================================
   Option B — Page Body Layout (FIXED)
   ========================================================= */

.tutorial-page-layout {
  display: flex;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;

  align-items: flex-start; /* 🔑 prevents vertical stretch */
}

/* Left: instructional image */
.tutorial-page-left {
  flex: 0 0 460px;
  display: flex;

  /* 🔑 FIX: stack images vertically instead of overlapping */
  flex-direction: column;
  gap: 12px;

  justify-content: center;
  align-items: flex-start;
}

/* Ensure image never forces height */
.tutorial-page-left img {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}

/* Right: narrator + dialogue */
.tutorial-page-right {
  flex: 1;
  min-width: 0; /* 🔑 prevents overflow */
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-sizing: border-box;
}

/* Narrator Chao */
.tutorial-narrator {
  flex: 0 0 96px;
}

.tutorial-narrator img {
  width: 96px;
  height: auto;
  image-rendering: pixelated;
}

/* Sprite dialogue container */
.tutorial-dialogue {
  flex: 1;
  min-width: 0;
  max-width: 800px;
  overflow: hidden;
}

/* Sprite text safety */
.tutorial-dialogue-sprites {
  max-width: 100%;
  overflow: hidden;
}

/* ============================================================
   CHAO RPG — BASE
============================================================ */

/* ============================
   Tutorial panels — contract pass
   ============================ */
#tutorial-intro-panel .panel-title,
#tutorial-pages-panel .panel-title {
  flex: 1;
  text-align: center;
}

#tutorial-intro-panel .panel-header-controls,
#tutorial-pages-panel .panel-header-controls {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

#tutorial-intro-panel .tutorial-intro-body,
#tutorial-pages-panel .tutorial-pages-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#tutorial-intro-panel .panel-content,
#tutorial-pages-panel .panel-content {
  flex: 1;
  min-height: 0;
}

#tutorial-pages-panel #tutorial-page-body {
  min-height: 0;
  overflow-y: auto;
}


/* extracted from styles/03-panel-contract.css — Shop ring display helpers */


/* extracted from styles/03-panel-contract.css — Journal achievements family */
/* ============================
   Stats & Achievements panel
   ============================ */
.journal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 0;
}

.journal-chao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  margin: 8px 0;
}

#journal-chao-preview canvas {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  border: 2px solid #415a77;
  border-radius: 6px;
  background: #000;
}

.achievement-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.achievement {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.25);
}

.achievement.locked {
  opacity: 0.6;
  filter: grayscale(0.3);
}

.achievement-title {
  font-weight: 700;
  margin-bottom: 2px;
}

.achievement-desc {
  font-size: 12px;
  opacity: 0.95;
}

.achievement-meta {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 4px;
}

/* extracted from styles/03-panel-contract.css — Dev panel family */
#dev-panel {
  background: rgba(20, 20, 24, 0.95);
  border: 2px solid rgba(255,255,255,0.2);

  min-width: 0;

  display: flex;
  flex-direction: column;
  z-index: 9055;
}

#dev-panel .dev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

#dev-panel .dev-title {
  font-weight: 700;
  letter-spacing: 0.5px;
}

#dev-panel .dev-close {
  width: 34px;
  height: 28px;
  border: 0;
  cursor: pointer;
}

#dev-panel .dev-body {
  min-width: 0;
  min-height: 0;
  padding: 10px;
  font-size: 14px;
}

#dev-panel .dev-section {
  margin-bottom: 10px;
}

#dev-panel .dev-label {
  font-weight: 700;
  margin-bottom: 6px;
}

#dev-panel .dev-speeds {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

#dev-panel .dev-speed {
  padding: 6px 0;
  cursor: pointer;
}

#dev-panel .dev-quick {
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

#dev-panel .dev-speed.active {
  outline: 2px solid rgba(255,255,255,0.55);
}

#dev-panel .dev-hint {
  margin-top: 6px;
  opacity: 0.85;
  font-size: 12px;
}

#dev-panel .dev-divider {
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 10px 0;
}

#dev-panel .dev-wipe {
  width: 100%;
  padding: 10px 0;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.3px;
}

#dev-panel .dev-warn {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.9;
}

/* ============================

/* =========================================
   Panel-contract breakup pass31 — options/customizer + shop/stats/trash compact authority
   ========================================= */

/* Stats / Inventory: inner body scrolling */
:is(#stats-panel, #inventory-panel) .panel-body{
  overflow:auto;
}

/* ============================
   Phase 5 Hotfixes: Shop/Stats/Trash/Editor/TM2
   ============================ */

/* SHOP: keep tabs inside the panel */
#shop-panel .tabs{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-right: 6px;

  margin-bottom: 8px;
  flex-shrink: 0;
}
#shop-panel .tabs > button{
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

#trash-panel > .panel-header > .panel-title{
  flex: 1 1 auto;
  min-width: 0;
}

#trash-panel > .panel-header > .panel-title{ padding-right: 10px; }

#trackmaker2-panel > .panel-header > .panel-header-controls{
  position: static !important;
  transform: none !important;
  margin-left: 10px !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

/* ============================
   HOTFIX: Shop/Trash/Stats (Phase5 followup)
   ============================ */

/* Shop should start closed (Panels.js controls visibility via .hidden + inline display) */

/* Trash: start closed + sane size + left-aligned header title */
#trash-panel:not(.hidden) { display: flex !important; flex-direction: column !important; }

#trash-panel .panel-header {
  display: flex !important;
  align-items: center !important;
  padding: 10px 12px !important;
  min-height: var(--panel-header-h, 44px) !important;
  box-sizing: border-box !important;
}
#trash-panel .panel-title { margin-right: auto !important; }
#trash-panel .panel-header-controls { 
  position: static !important;
  transform: none !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

/* Stats: align points to bar right edge by making bars fill available width */
#stats-panel .stat-row { width: 100%; 
  min-width: 0;
}
#stats-panel .stat-bars { flex: 1 1 auto; min-width: 0; }
#stats-panel .upper-bar,
#stats-panel .lower-bar { width: 100% !important; max-width: 100% !important; }
#stats-panel .stat-points { padding-right: 6px; }

/* ============================
   Panel Conversion Phase — Dev / PaperDoll / Debug / ShopConfirm
   ============================ */
:is(#dev-panel,
#stats-debug-panel) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


:is(#dev-panel,
#stats-debug-panel) .panel-header {
  min-height: 38px;
  box-sizing: border-box;
}

:is(#dev-panel,
#stats-debug-panel) .panel-title {
  font-weight: 700;
}

:is(#dev-panel,
#stats-debug-panel) .panel-body {
  flex: 1 1 auto;
  min-height: 0;
}

#dev-panel .panel-header-controls .panel-close-x {
  width: 34px;
  height: 28px;
  border: 0;
  cursor: pointer;
}

#stats-debug-panel {
  min-width: 0;
  padding: 0;

  position: absolute;
  z-index: 3000;
  background: #1b263b;
  border: 2px solid #415a77;
  border-radius: 12px;
  color: #fff;
  display: none;
}

#stats-debug-panel .panel-body {
  padding: 10px;
  overflow: auto;
}

#paperdoll-panel {
  z-index: 150 !important;
  padding: 0;
}

#paperdoll-panel .panel-body {
  padding: 10px;
  overflow: auto;
}

#shop-confirm-panel {
  padding: 0;

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  background: rgba(10, 20, 30, 0.95);
  border: 2px solid #00b4d8;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
  color: #fff;
  z-index: 10010;
}

#shop-confirm-panel .panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  text-align: center;
}

#shop-confirm-panel .shop-confirm-buttons {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 0 16px 0;
}

#shop-confirm-panel .shop-confirm-buttons .ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
}

#rpg-class-panel .panel-title,
#rpg-talents-panel .panel-title,
#rpg-equip-panel .panel-title,
#rpg-inventory-panel .panel-title,
#rpg-shop-panel .panel-title,
#chaorpg-party-panel .panel-title,
#chaorpg-log-panel .panel-title {
  color: inherit;
}

#chaorpg-party-panel .panel-header-controls,
#chaorpg-log-panel .panel-header-controls {
  min-width: 34px;
}


/* ============================================================
   Karate Tournament MP
   ============================================================ */
#vote-karate-tournament { position: relative; }
.lp-banner-caption {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ktmp-body {
  background: linear-gradient(180deg, rgba(24,29,44,0.94), rgba(10,12,19,0.96));
  color: #eef3ff;
  overflow: auto;
}

.ktmp-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
}

.ktmp-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 4px 2px 0;
}

.ktmp-status {
  font-size: 18px;
  font-weight: 700;
}

.ktmp-meta {
  font-size: 13px;
  opacity: 0.86;
}

.ktmp-current-match {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.05);
}
.ktmp-current-match.idle { opacity: 0.92; }
.ktmp-current-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}
.ktmp-current-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}
.ktmp-vs {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.1em;
  opacity: 0.75;
}
.ktmp-wait {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.82;
}

.ktmp-rounds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

.ktmp-round {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ktmp-round-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.84;
}

.ktmp-match {
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}
.ktmp-match.active {
  border-color: rgba(255, 218, 104, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 218, 104, 0.2), 0 0 22px rgba(255,218,104,0.18);
}
.ktmp-match.done { opacity: 0.96; }
.ktmp-match-footer {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.78;
}

.ktmp-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 12px;
  padding: 6px 8px;
  background: rgba(0,0,0,0.22);
}
.ktmp-entry + .ktmp-entry { margin-top: 6px; }
.ktmp-entry-empty {
  opacity: 0.45;
}
.ktmp-side {
  width: 16px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.7;
}
.ktmp-puck {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 28px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
}
.ktmp-puck img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}
.ktmp-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}

/* ============================
   Matchmake Panel
   ============================ */
.matchmake-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}
.matchmake-topbar {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto auto;
  gap: 10px;
  align-items: end;
}
.matchmake-mode-card,
.matchmake-top-field,
.matchmake-top-check {
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 10px;
}
.matchmake-mode-label,
.matchmake-top-field > span {
  font-size: 12px;
  opacity: 0.8;
  display: block;
  margin-bottom: 6px;
}
.matchmake-mode-value {
  font-size: 18px;
  font-weight: 700;
}
.matchmake-top-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
}
.matchmake-select {
  width: 100%;
  min-height: 48px;
}
.matchmake-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.mm-btn {
  min-width: 140px;
  min-height: 36px;
}
.mm-btn.primary {
  font-weight: 700;
}
.mm-btn.accent {
  font-weight: 700;
}
.matchmake-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 24px;
  font-size: 13px;
}
.matchmake-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
}
.matchmake-left,
.matchmake-right {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.matchmake-slot {
  min-height: 0;
  flex: 1 1 auto;
}
#mm-player-list-slot {
  overflow: auto;
  padding-right: 4px;
}
#mm-player-list-slot,
#mm-waiting-room-slot {
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 10px;
}
.mm-player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
}
.mm-player-card.is-mine {
  background: rgba(255,255,255,0.1);
}
.mm-player-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  image-rendering: pixelated;
}
.mm-player-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.mm-player-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mm-player-name {
  font-weight: 700;
}
.mm-player-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.mm-player-chao {
  font-size: 12px;
  opacity: 0.82;
}
.mm-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.12);
}
.mm-tag.mine { background: rgba(90, 170, 255, 0.3); }
.mm-tag.host { background: rgba(255, 215, 90, 0.28); }
.mm-tag.bot { background: rgba(255,255,255,0.2); }
.mm-waiting-room {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}
.mm-waiting-room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mm-wr-meta {
  font-size: 12px;
  opacity: 0.82;
}
.mm-waiting-stage {
  flex: 1 1 auto;
  min-height: 420px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 50% 12%, rgba(255,255,255,0.12), transparent 28%),
    linear-gradient(to bottom, rgba(110,180,255,0.18), rgba(50,110,60,0.18));
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  overflow: auto;
}
.mm-stage-chao {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 118px;
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 10px 8px;
  text-align: center;
}
.mm-stage-chao.is-mine {
  outline: 2px solid rgba(90,170,255,0.55);
}
.mm-stage-icon {
  width: 54px;
  height: 54px;
  object-fit: contain;
  image-rendering: pixelated;
}
.mm-stage-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
}
.mm-stage-owner {
  font-size: 11px;
  opacity: 0.82;
}

.garden-item.toy-seesaw {
  width: 96px !important;
  height: 56px !important;
  overflow: visible !important;
}
.garden-item.toy-seesaw > img {
  display: none;
}
.garden-item.toy-seesaw .seesaw-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.garden-item.toy-seesaw .seesaw-pivot {
  position: absolute;
  left: 42px;
  top: 22px;
  width: 12px;
  height: 26px;
  background: linear-gradient(180deg, #d8a16d 0%, #8a582f 100%);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
.garden-item.toy-seesaw .seesaw-board {
  position: absolute;
  left: 10px;
  top: 14px;
  width: 76px;
  height: 8px;
  border-radius: 6px;
  background: linear-gradient(180deg, #f56b6b 0%, #b63c3c 100%);
  transform-origin: 50% 50%;
}
.garden-item.toy-seesaw .seesaw-seat {
  position: absolute;
  top: -6px;
  width: 14px;
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(180deg, #8fb8ff 0%, #4b76d8 100%);
  border: 1px solid rgba(28, 45, 97, 0.8);
}
.garden-item.toy-seesaw .seesaw-seat.left { left: -2px; }
.garden-item.toy-seesaw .seesaw-seat.right { right: -2px; }

.garden-item.toy-swing {
  overflow: visible !important;
}
.garden-item.toy-swing > img,
.garden-item.toy-spring-ride > img {
  display: none;
}
.garden-item.toy-swing .swing-visual,
.garden-item.toy-spring-ride .spring-visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.garden-item.toy-swing .swing-frame {
  position: absolute;
  inset: 0;
}
.garden-item.toy-swing .swing-frame::before,
.garden-item.toy-swing .swing-frame::after {
  content: "";
  position: absolute;
  bottom: 12px;
  width: 6px;
  height: 72px;
  background: linear-gradient(180deg, #7f5736 0%, #52331e 100%);
  border-radius: 4px;
}
.garden-item.toy-swing-single .swing-frame::before { left: 14px; transform: rotate(8deg); }
.garden-item.toy-swing-single .swing-frame::after { right: 14px; transform: rotate(-8deg); }
.garden-item.toy-swing-duo .swing-frame::before { left: 18px; transform: rotate(10deg); }
.garden-item.toy-swing-duo .swing-frame::after { right: 18px; transform: rotate(-10deg); }
.garden-item.toy-swing .swing-frame:after,
.garden-item.toy-swing .swing-frame:before {
  box-shadow: 0 -72px 0 0 rgba(0,0,0,0);
}
.garden-item.toy-swing .swing-frame {
  border-top: 8px solid #b56d49;
  border-radius: 8px 8px 0 0;
  top: 8px;
  left: 14px;
  right: 14px;
  bottom: 0;
}
.garden-item.toy-swing-single .swing-seat,
.garden-item.toy-swing-duo .swing-seat {
  position: absolute;
  top: 28px;
  width: 24px;
  height: 32px;
  transform-origin: 50% 8px;
}
.garden-item.toy-swing .swing-seat::before,
.garden-item.toy-swing .swing-seat::after {
  content: "";
  position: absolute;
  top: -18px;
  width: 2px;
  height: 18px;
  background: #d3d7df;
}
.garden-item.toy-swing .swing-seat::before { left: 6px; }
.garden-item.toy-swing .swing-seat::after { right: 6px; }
.garden-item.toy-swing .swing-seat.center { left: 26px; }
.garden-item.toy-swing .swing-seat.left { left: 20px; }
.garden-item.toy-swing .swing-seat.right { right: 20px; }
.garden-item.toy-swing .swing-seat {
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #78a8ff 0%, #355da6 100%);
  border: 1px solid rgba(18, 29, 67, 0.8);
}
.garden-item.toy-spring-ride {
  overflow: visible !important;
}
.garden-item.toy-spring-ride .spring-base {
  position: absolute;
  left: 16px;
  bottom: 6px;
  width: 52px;
  height: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #6d7f55 0%, #465137 100%);
}
.garden-item.toy-spring-ride .spring-coil {
  position: absolute;
  left: 34px;
  bottom: 16px;
  width: 16px;
  height: 30px;
  border: 3px solid #c8d0d8;
  border-top: none;
  border-bottom: none;
  border-radius: 12px;
  transform-origin: 50% 100%;
}
.garden-item.toy-spring-ride .spring-rider {
  position: absolute;
  left: 18px;
  bottom: 36px;
  width: 48px;
  height: 28px;
  transform-origin: 50% 100%;
}
.garden-item.toy-spring-ride .spring-rider.horse {
  background: linear-gradient(180deg, #d59b63 0%, #8e5e31 100%);
  clip-path: polygon(8% 62%, 18% 38%, 34% 32%, 44% 6%, 64% 6%, 74% 28%, 88% 38%, 90% 56%, 80% 68%, 66% 70%, 56% 94%, 42% 94%, 38% 72%, 18% 72%);
}
.garden-item.toy-spring-ride .spring-rider.car {
  background: linear-gradient(180deg, #f06a6a 0%, #a53b3b 100%);
  clip-path: polygon(8% 64%, 18% 40%, 34% 26%, 64% 26%, 80% 40%, 92% 64%, 84% 76%, 14% 76%);
}
.garden-item.toy-spring-ride .spring-rider.car::before,
.garden-item.toy-spring-ride .spring-rider.car::after {
  content: "";
  position: absolute;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2c3445;
}
.garden-item.toy-spring-ride .spring-rider.car::before { left: 6px; }
.garden-item.toy-spring-ride .spring-rider.car::after { right: 6px; }




/* pass12: music/tutorial exact-selector ownership migrated from 03-panel-contract.css */
#music-tracklist-footer .music-btn {
  min-width: 150px;
}

#musicplayer-track-title {
  font-size: clamp(18px, 2vw, 28px);
}

@media (max-width: 980px) {
  #tutorial-pages-panel .panel-content {
    padding: 12px;
  }

  #music-tracklist-footer .music-btn {
    width: 100%;
  }
}
