* { box-sizing: border-box; }

:root {
  --gold:              #c8a84b;
  --gold-light:        #e2c97e;
  --gold-dark:         #7a621e;
  --gold-border:       rgba(200, 168, 75, 0.55);
  --gold-border-faint: rgba(200, 168, 75, 0.18);
  --gold-fill:         rgba(200, 168, 75, 0.12);
  --bg:                #0b0f1a;
  --panel-bg-top:      #131c2e;
  --panel-bg-bot:      #0d1520;
  --text:              #d4cba8;
  --text-dim:          #6a6245;
  --text-bright:       #f0ead8;
  --blue:              #4a7fa8;
  --blue-light:        #7ec8e3;
  --blue-glow:         rgba(126, 200, 227, 0.45);
  --tank-color:        #4a7fa8;
  --healer-color:      #6fcf97;
  --dps-color:         #c14b4b;
}

/* Ensure the root element matches the overlay background so no white edge shows */
html {
  height: 100%;
  background-color: var(--bg);
}

body {
  font-family: 'Cinzel', Georgia, 'Times New Roman', serif;
  margin: 0;
  padding: 0;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 15% 40%, rgba(15, 35, 75, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 85% 10%, rgba(40, 15, 80, 0.30) 0%, transparent 55%);
  min-height: 100vh;
  /* Make layout a column so main content can expand to fill the viewport */
  display: flex;
  flex-direction: column;
}

/* ─── Shared corner-bracket decoration ───────────────── */
header::before, header::after,
.panel::before,  .panel::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--gold);
  border-style: solid;
}
header::before, .panel::before { top: -1px;    left: -1px;  border-width: 2px 0 0 2px; }
header::after,  .panel::after  { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* ─── Header ─────────────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(22, 33, 55, 0.98) 0%, rgba(11, 18, 32, 0.99) 100%);
  border: 1px solid var(--gold-border);
  position: relative;
}

h1 {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow:
    0 0 24px rgba(200, 168, 75, 0.60),
    0 0  6px rgba(200, 168, 75, 0.30),
    0 1px 3px rgba(0, 0, 0, 0.90);
}

/* Location span: keep normal casing and slightly brighter text */
#location {
  margin-left: 8px;
  color: var(--text-bright);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.02em;
}

.crystal {
  color: var(--blue-light);
  margin-right: 6px;
  font-size: 10px;
  vertical-align: middle;
  text-shadow: 0 0 12px var(--blue-glow);
}

#status {
  font-size: 10px;
  letter-spacing: 0.10em;
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
}

/* Controls removed — layout adjusted for header-only UI */

button {
  padding: 4px 14px;
  border: 1px solid var(--gold-dark);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(200,168,75,0.14) 0%, rgba(200,168,75,0.04) 100%);
  color: var(--gold-light);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

button:hover {
  background: linear-gradient(180deg, rgba(200,168,75,0.32) 0%, rgba(200,168,75,0.14) 100%);
  border-color: var(--gold);
  color: var(--text-bright);
  box-shadow: 0 0 10px rgba(200,168,75,0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}

button:focus, select:focus {
  outline: 1px solid var(--gold-dark);
  outline-offset: 1px;
}

select {
  padding: 4px 10px;
  border: 1px solid var(--gold-border-faint);
  border-radius: 0;
  background: rgba(11, 18, 32, 0.90);
  color: var(--text-dim);
  font-family: 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.05em;
  cursor: pointer;
}

/* ─── Main / Container ───────────────────────────────── */
main { margin-top: 0; }

#container {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  /* Allow the container to grow and fill available vertical space */
  flex: 1 1 auto;
  min-height: 0; /* allow children to shrink properly inside flex */
}

/* ─── Panel ──────────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, var(--panel-bg-top) 0%, var(--panel-bg-bot) 100%);
  border: 1px solid var(--gold-border);
  position: relative;
  overflow: hidden;
}

#panel-dps { flex: 1 1 100%; width: 100%; min-width: 0; display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ─── Panel Header ───────────────────────────────────── */
.panel h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  padding: 7px 14px;
  background: linear-gradient(90deg, rgba(200,168,75,0.14) 0%, transparent 80%);
  border-bottom: 1px solid var(--gold-border-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 14px rgba(200,168,75,0.45);
}

.section-icon {
  color: var(--gold);
  font-size: 8px;
  text-shadow: 0 0 10px rgba(200,168,75,0.6);
}

/* ─── DPS List ───────────────────────────────────────── */
.dps-list { padding: 8px 12px 10px; font-size: 12px; overflow: auto; flex: 1 1 auto; min-height: 0; }

.dps-total {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-bright);
  letter-spacing: 0.10em;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--gold-border-faint);
  text-shadow: 0 0 16px rgba(126, 200, 227, 0.45);
}

.dps-rows {}

.dps-columns {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.dps-column {
  flex: 1 1 50%;
  min-width: 0;
}

.dps-column .column-title {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--gold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dps-column .dps-row { margin-bottom: 2px; }



.dps-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 2px;
  border-bottom: 1px solid rgba(200,168,75,0.07);
  position: relative;
  overflow: hidden;
}

.dps-row:last-child { border-bottom: none; }

/* Horizontal DPS fill bar */
.dps-name {
  position: relative;
  overflow: hidden;
}

/* Let the name area take available space so the fill bar is visible */
.dps-row .dps-name {
  flex: 1 1 auto;
  min-width: 0; /* allow text truncation inside flex */
  padding-right: 8px;
}

.dps-row .dps-value {
  flex: 0 0 auto;
  margin-left: 8px;
  white-space: nowrap;
}

.dps-name {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.07em;
  color: var(--text);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dps-name .name-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dps-name .player-name, .dps-name .player-job {
  position: relative;
  z-index: 1;
  display: inline-block;
}

/* Mini bar under the name showing percent of party total */
.mini-bar {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  width: var(--bar-pct, 0%);
  transition: width 0.35s ease;
  background: linear-gradient(90deg, rgba(74,127,168,0.28) 0%, rgba(74,127,168,0.06) 100%);
}

.mini-bar-percent {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-bright);
  text-shadow: 0 0 6px rgba(0,0,0,0.6);
  z-index: 2;
  pointer-events: none;
}

/* Role-specific fills */
.dps-name.tank .mini-bar-fill {
  background: linear-gradient(90deg, rgba(74,127,168,0.36) 0%, rgba(74,127,168,0.12) 100%);
}
.dps-name.healer .mini-bar-fill {
  background: linear-gradient(90deg, rgba(111,207,151,0.36) 0%, rgba(111,207,151,0.10) 100%);
}
.dps-name.dps .mini-bar-fill {
  background: linear-gradient(90deg, rgba(193,75,75,0.36) 0%, rgba(193,75,75,0.10) 100%);
}

.dps-name {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.07em;
  color: var(--text);
  position: relative;
}

.dps-name .player-job {
  font-size: 10px;
  color: var(--text-dim);
  margin-left: 8px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.dps-value {
  font-family: 'Cinzel', Consolas, monospace;
  font-size: 11px;
  color: var(--blue-light);
  letter-spacing: 0.06em;
  text-shadow: 0 0 10px var(--blue-glow);
  position: relative;
}

.dps-empty {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-align: center;
  padding: 14px 0;
}

/* ─── Footer ─────────────────────────────────────────── */
#site-footer {
  margin-top: 0;
  padding: 10px 12px;
  text-align: center;
  border-top: 1px solid var(--gold-border-faint);
  color: var(--text-dim);
  font-size: 12px;
}

#site-footer .footer-inner { display:inline-block; padding:4px 8px; }

#site-footer a {
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.06em;
}

#site-footer a:hover {
  color: var(--text-bright);
  text-shadow: 0 0 10px rgba(200,168,75,0.18);
}
