:root {
  --gold: #c9a227;
  --gold-bright: #e8c766;
  --parchment: #e8e0cc;
  --panel: rgba(16, 13, 24, 0.88);
  --panel-border: rgba(201, 162, 39, 0.35);
  --violet: #9b30ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #07060c;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--parchment);
}

#app { position: relative; width: 100%; height: 100%; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

/* ---------- loading ---------- */
.screen {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: radial-gradient(ellipse at center, #16101f 0%, #07060c 70%);
}
.loading-rune {
  font-size: 56px; color: var(--gold);
  animation: pulse 2s ease-in-out infinite;
  text-shadow: 0 0 24px rgba(201, 162, 39, 0.7);
}
.screen h1 {
  font-size: 34px; letter-spacing: 8px; font-weight: 400;
  color: var(--parchment); text-transform: uppercase;
}
.bar {
  width: 320px; height: 6px; border: 1px solid var(--panel-border);
  border-radius: 3px; overflow: hidden;
}
#load-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width .3s ease;
}
#load-text { font-size: 14px; font-style: italic; opacity: 0.8; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

/* ---------- top bar ---------- */
#topbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
#turn-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--panel-border);
  padding: 8px 22px; border-radius: 24px; font-size: 16px; letter-spacing: 1px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
#turn-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-w { background: #f0ead8; box-shadow: 0 0 10px #f0ead8; }
.dot-b { background: #6a5acd; box-shadow: 0 0 10px #6a5acd; }

#status-toast {
  background: rgba(120, 20, 20, 0.92); border: 1px solid rgba(255, 90, 60, 0.6);
  color: #ffd9c9; padding: 6px 18px; border-radius: 16px; font-size: 14px;
  letter-spacing: 2px; text-transform: uppercase;
  animation: pulse 1s ease-in-out infinite;
}

/* ---------- panels ---------- */
.panel {
  position: absolute; z-index: 10; width: 252px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 14px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 30px rgba(0,0,0,0.55);
}
#left-panel { left: 14px; top: 76px; bottom: 14px; display: flex; flex-direction: column; }
#right-panel { right: 14px; top: 76px; max-height: calc(100% - 92px); overflow-y: auto; }

.panel h2 {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--gold); margin-bottom: 10px; font-weight: 400;
  border-bottom: 1px solid var(--panel-border); padding-bottom: 6px;
}
.panel h3 {
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold); margin: 12px 0 6px; font-weight: 400;
}

#move-list {
  list-style: none; overflow-y: auto; flex: 1; min-height: 120px;
  font-size: 13px; line-height: 1.7;
}
#move-list li { display: grid; grid-template-columns: 34px 1fr 1fr; }
.mv-num { color: rgba(232, 224, 204, 0.45); }

#captured { border-top: 1px solid var(--panel-border); padding-top: 8px; margin-top: 8px; }
.cap-row { display: flex; gap: 8px; font-size: 18px; min-height: 24px; }
.cap-label { font-size: 11px; color: rgba(232,224,204,0.5); width: 70px; padding-top: 3px; }
#cap-w, #cap-b { letter-spacing: 2px; }

/* ---------- controls ---------- */
#panel-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab {
  flex: 1; background: transparent; color: rgba(232,224,204,0.6);
  border: 1px solid var(--panel-border); border-radius: 6px;
  padding: 7px 0; font-family: inherit; font-size: 13px; letter-spacing: 1px;
  cursor: pointer; transition: all .15s ease;
}
.tab:hover { color: var(--gold-bright); }
.tab.active {
  background: linear-gradient(180deg, #3d2f14, #241b0a);
  border-color: var(--gold); color: var(--gold-bright);
}

.row { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

.btn {
  background: linear-gradient(180deg, #241d33, #17121f);
  color: var(--parchment); border: 1px solid var(--panel-border);
  border-radius: 6px; padding: 8px 14px; font-family: inherit; font-size: 13px;
  letter-spacing: 1px; cursor: pointer; transition: all .15s ease;
}
.btn:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary {
  background: linear-gradient(180deg, #3d2f14, #241b0a);
  border-color: var(--gold); color: var(--gold-bright);
}
.btn.small { padding: 5px 10px; font-size: 12px; }

.check { font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.check input { accent-color: var(--gold); }

select {
  background: #17121f; color: var(--parchment);
  border: 1px solid var(--panel-border); border-radius: 6px;
  padding: 6px 8px; font-family: inherit; font-size: 13px;
}

.hint { font-size: 11px; opacity: 0.55; font-style: italic; line-height: 1.5; }

/* ---------- inspector ---------- */
#insp-clips { gap: 6px; }
#insp-bones { list-style: none; font-size: 12px; max-height: 130px; overflow-y: auto;
  border: 1px solid rgba(201,162,39,0.15); border-radius: 6px; padding: 6px; }
#insp-bones li { padding: 1px 4px; color: #8fd0ff; font-family: ui-monospace, monospace; font-size: 11px; }
.stats { font-size: 12px; line-height: 1.8; color: rgba(232,224,204,0.85); }
.stats b { color: var(--gold-bright); font-weight: 400; }

/* ---------- modals ---------- */
.modal {
  position: absolute; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 3, 8, 0.7); backdrop-filter: blur(3px);
}
.modal-box {
  background: var(--panel); border: 1px solid var(--gold);
  border-radius: 12px; padding: 30px 40px; text-align: center;
  box-shadow: 0 0 60px rgba(201, 162, 39, 0.25);
}
.modal-box h1 { font-size: 30px; font-weight: 400; letter-spacing: 4px; margin-bottom: 8px; }
.modal-box h2 { font-size: 16px; font-weight: 400; letter-spacing: 2px; margin-bottom: 16px; }
.modal-box p { opacity: 0.8; margin-bottom: 20px; }
.promo-row { display: flex; gap: 10px; justify-content: center; }
.btn.promo { padding: 12px 18px; font-size: 15px; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(201,162,39,0.3); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
