/* Critical fallback so the page isn't a flash of white/unstyled content
   before the Tailwind CDN script finishes scanning the DOM and injecting
   its generated utility classes (bg-steel-950 etc. on <body>). This is a
   plain stylesheet, so it applies immediately without waiting on JS. */
html,
body {
  background-color: #0a1219;
  color: #e2e8f0;
  margin: 0;
}

/* Boon/Affliction/Map Affliction "term" links — hover to see the
   description. The tooltip itself is a JS-positioned, fixed-position
   element (#globalTooltip in app.js) rather than a CSS ::after, because
   several terms live inside scrollable containers (.item-list) whose
   `overflow-y: auto` would otherwise clip a tooltip positioned above the
   term via absolute positioning. */
.term {
  color: #7fe3f5;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
}

#globalTooltip {
  position: fixed;
  display: none;
  background: #0a1219;
  border: 1px solid #2a4a5e;
  color: #e2e8f0;
  padding: 0.4rem 0.6rem;
  font-size: 0.7rem;
  line-height: 1.3;
  white-space: normal;
  width: max-content;
  max-width: 220px;
  z-index: 1000;
  border-radius: 0.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
#globalTooltip.visible {
  display: block;
}

.panel {
  background: linear-gradient(180deg, #132836 0%, #0d1b26 100%);
  border: 1px solid #1c3646;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.panel-title {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1rem;
  color: #a5edfa;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #1c3646;
  padding-bottom: 0.5rem;
}

.field {
  background: #0a1219;
  border: 1px solid #2a4a5e;
  border-radius: 0.25rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.875rem;
  color: #e2e8f0;
}
.field:focus {
  outline: none;
  border-color: #7fe3f5;
}

.btn {
  border-radius: 0.25rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  transition: filter 0.15s ease, opacity 0.15s ease;
  border: 1px solid transparent;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn:not(:disabled):hover {
  filter: brightness(1.15);
}
.btn-ice {
  background: rgba(127, 227, 245, 0.15);
  border-color: #7fe3f5;
  color: #a5edfa;
}
.btn-boon {
  background: rgba(63, 191, 106, 0.15);
  border-color: #3fbf6a;
  color: #5fd689;
}
.btn-affliction {
  background: rgba(184, 71, 31, 0.18);
  border-color: #b8471f;
  color: #d66a3d;
}
.btn-personal {
  background: rgba(148, 85, 211, 0.18);
  border-color: #9455d3;
  color: #b07de8;
}
.btn-ghost {
  background: transparent;
  border-color: #3d6579;
  color: #94a3b8;
}

.empty-msg {
  font-size: 0.75rem;
  color: #b8471f;
  text-align: center;
}

/* Gadgets — two vertical slot reels (Grenades, Smokes) that roll upward. */
.vslot-viewport {
  position: relative;
  width: 70px;
  height: 64px;
  overflow: hidden;
  background: #0a1219;
  border: 1px solid #2a4a5e;
  border-radius: 0.25rem;
}
.vslot-strip {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  will-change: transform;
}
.vslot-item {
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #e2e8f0;
  border-bottom: 1px solid #1c3646;
}
.vslot-pointer {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: #5fd689;
  box-shadow: 0 0 6px rgba(95, 214, 137, 0.8);
  transform: translateY(-50%);
}
.vslot-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #3d6579;
}

/* Wheel */
.wheel-wrap {
  position: relative;
  width: 200px;
  height: 200px;
}
.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #1c3646;
  box-shadow: 0 0 0 4px #0a1219, inset 0 0 20px rgba(0, 0, 0, 0.4);
  transform: rotate(0deg);
  will-change: transform;
}
.wheel svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
}
.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 16px solid #7fe3f5;
  z-index: 5;
  filter: drop-shadow(0 0 4px rgba(127, 227, 245, 0.6));
}

/* Weapon slot strip */
.slot-viewport {
  position: relative;
  height: 56px;
  overflow: hidden;
  background: #0a1219;
  border: 1px solid #2a4a5e;
  border-radius: 0.25rem;
}
.slot-strip {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  height: 100%;
  will-change: transform;
}
.slot-item {
  flex: 0 0 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #e2e8f0;
  border-right: 1px solid #1c3646;
  padding: 0 0.5rem;
  text-align: center;
}
.slot-pointer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #7fe3f5;
  box-shadow: 0 0 6px rgba(127, 227, 245, 0.8);
  transform: translateX(-50%);
}

.loadout-card {
  margin-top: 0.75rem;
  background: #0a1219;
  border: 1px solid #2a4a5e;
  border-radius: 0.25rem;
  padding: 0.75rem;
  font-size: 0.875rem;
}

.edit-details {
  font-size: 0.8rem;
  color: #94a3b8;
}
.edit-details summary {
  cursor: pointer;
  user-select: none;
  padding: 0.25rem 0;
}
.item-list {
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 140px;
  overflow-y: auto;
}
.item-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0a1219;
  border: 1px solid #1c3646;
  border-radius: 0.2rem;
  padding: 0.25rem 0.5rem;
  gap: 0.5rem;
}
.item-list .item-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}
.item-list button {
  color: #7fe3f5;
  font-size: 0.75rem;
}
.item-list button.danger {
  color: #d66a3d;
}
.add-item-form {
  display: flex;
  gap: 0.4rem;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #0a1219;
  border: 1px solid #2a4a5e;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}
.player-chip button {
  color: #d66a3d;
  font-size: 0.7rem;
}

.filter-tab {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #2a4a5e;
  color: #94a3b8;
}
.filter-tab.active {
  background: rgba(127, 227, 245, 0.15);
  border-color: #7fe3f5;
  color: #a5edfa;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 420px;
  overflow-y: auto;
}
.log-round {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid #2a4a5e;
  border-radius: 0.3rem;
  padding: 0.6rem 0.75rem;
  background: #0a1219;
}
.log-round-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid #1c3646;
  padding-bottom: 0.35rem;
}
.log-round-player {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  color: #a5edfa;
}
.log-round-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.log-round-row {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
}
.log-round-row .cat-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border-radius: 0.2rem;
  flex-shrink: 0;
}
.cat-BOON { background: rgba(63,191,106,0.2); color: #5fd689; }
.cat-AFFLICTION { background: rgba(184,71,31,0.2); color: #d66a3d; }
.cat-WEAPON { background: rgba(127,227,245,0.2); color: #a5edfa; }
.cat-PERSONAL { background: rgba(148,85,211,0.2); color: #b07de8; }

.log-round-header time {
  color: #3d6579;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* This Round */
.round-map-affliction {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #2a4a5e;
  border-radius: 0.3rem;
  padding: 0.5rem 0.75rem;
  background: #0a1219;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.round-player-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 380px;
  overflow-y: auto;
}
.round-player-row {
  border: 1px solid #2a4a5e;
  border-radius: 0.3rem;
  padding: 0.5rem 0.75rem;
  background: #0a1219;
}
.round-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.round-player-name {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  color: #a5edfa;
}
.round-player-pending {
  font-size: 0.75rem;
  color: #3d6579;
  font-style: italic;
}
.round-player-row .log-round-body {
  margin-top: 0.4rem;
}

/* History */
.history-player-block {
  border-top: 1px solid #1c3646;
  padding-top: 0.35rem;
  margin-top: 0.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.history-player-name {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  color: #b07de8;
}
