* { box-sizing: border-box; }

:root{
  --bg: #edf2f7;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #334155;
  --line: #d8e0ea;
  --brand1: #1d73c9;
  --brand2: #0f4f93;
  --chip: #eef3fb;
  --chipText: #0f2d4a;
  --chipActive: #0d4f91;
  --chipActiveText: #fff;
  --shadow: 0 10px 30px rgba(0,0,0,0.10);
}

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.topbar{
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  color: #fff;
  padding: 18px 18px;
}

.topbar-inner{
  max-width: 1320px;
  margin: 0 auto;
}

.brand{
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .2px;
}

.subtitle{
  font-size: 14px;
  opacity: .95;
  margin-top: 4px;
}

.container{
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 14px 40px;
}

h1{
  text-align: center;
  font-size: 40px;
  margin: 10px 0 22px;
  letter-spacing: .6px;
}

.panel{
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.toolbar-block{ margin-bottom: 16px; }

.toolbar-title{
  font-weight: 800;
  margin-bottom: 10px;
  font-size: 16px;
  color: #0b2038;
}

.chip-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip{
  border: 1px solid rgba(13,79,145,0.12);
  background: var(--chip);
  color: var(--chipText);
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .06s ease, background .18s ease, border-color .18s ease;
  -webkit-tap-highlight-color: transparent;
}

.chip:active{ transform: scale(0.98); }

.chip.active{
  background: var(--chipActive);
  color: var(--chipActiveText);
  border-color: rgba(255,255,255,0.25);
}

.meta{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 14px;
  background: #f6f8fb;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.06);
  margin: 6px 0 12px;
}

.meta-title{
  font-size: 22px;
  font-weight: 900;
  margin: 0;
}

.meta-sub{
  font-size: 15px;
  color: var(--muted);
  margin-top: 2px;
}

.badge{
  background: rgba(29,115,201,0.10);
  color: #0b3d73;
  border: 1px solid rgba(29,115,201,0.18);
  font-weight: 800;
  padding: 10px 14px;
  border-radius: 999px;
}

.map-note{
  margin: 10px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(30, 88, 148, 0.08);
  color: #24425f;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid rgba(30,88,148,0.10);
}

.map-card{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
  overflow: hidden;
}

.map-wrap{
  position: relative;
  padding: 12px;
  text-align: center;
  background: #f8fafc;
}

.map-wrap img{
  width: 100%;
  max-width: 1200px;
  height: auto;
  border-radius: 10px;
  display: block;
}

.placeholder{
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  color: #667;
  font-size: 18px;
  padding: 18px;
  background: #f8fafc;
  border-radius: 10px;
}

.player{
  display: grid;
  grid-template-columns: auto auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.pbtn{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(13,79,145,0.12);
  background: #eef3fb;
  color: #0f2d4a;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.pbtn.primary{
  background: #0d4f91;
  color: #fff;
  border-color: rgba(255,255,255,0.18);
}

.range{
  width: 100%;
  accent-color: #0d4f91;
}

.step-readout{
  text-align: right;
  min-width: 86px;
}

.step-label{
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  line-height: 1.1;
}

.step-value{
  font-size: 18px;
  font-weight: 900;
  color: #0b2038;
}

.actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.action-btn{
  flex: 1 1 180px;
  text-align: center;
  border: 0;
  border-radius: 12px;
  background: #2d7fd3;
  color: #fff;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s ease;
}

.action-btn:hover{ background: #165ea7; }

.action-btn.ghost{
  background: #eef3fb;
  color: #0f2d4a;
  border: 1px solid rgba(13,79,145,0.18);
}

.action-btn.ghost:hover{ background: #e4edf9; }

@media (max-width: 768px){
  h1{ font-size: 28px; }
  .brand{ font-size: 22px; }
  .meta-title{ font-size: 18px; }
  .meta-sub{ font-size: 14px; }
  .player{
    grid-template-columns: auto auto auto 1fr;
    grid-template-areas:
      "prev play next range"
      "read read read read";
  }
  .step-readout{
    grid-column: 1 / -1;
    text-align: right;
    margin-top: 4px;
  }
}
