body.preload #controls,
body.preload #infoContainer, 
body.preload #status, 
body.preload #listPreview,
body.preload h1 {
  display: none;
}

body {
  font-family: Arial, sans-serif;
  background: #222;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;

  overflow: hidden;
  overflow-y: scroll;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.body::-webkit-scrollbar {
  display: none;
}

h1 {
  margin-bottom: 10px;
}

h4 {
  margin-top: 10px;
  margin-bottom: 5px;
  color: white;
}

a:link {
  color: rgb(0, 165, 0);
}

a:hover {
  color: rgb(0, 216, 0);
}

a:visited {
  color: rgb(0, 165, 0);
}

#controls {
  display: flex;
  flex-direction: column;
  align-items: left;
  gap: 12px;
  margin-bottom: 5px;
}

.control-row {
  display: flex;
  flex-direction: column;
  align-items: left;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 3px;
  padding: 12px;
}

#gameOptions {
  background-color: #503C00;
}

#gameOptionsHeader {
  color: #FFF34B;
}

#modeOptions {
  background-color: #003214;
}

#modeOptionsHeader {
  color: #31F626;
}

.mode-options {
  flex-direction: column;
}

#modifiers {
  background-color: #001e3c;
}

#modifiersHeader {
  color: #63C6f5;
}

#output {
  display: block;
}

input {
  padding: 8px;
  font-size: 16px;
  width: 160px;
  margin-right: 8px;
  background: black;
  color: white;
}

.game-ui {
  background: #001e3c;
  box-shadow: none;
  margin: 0;
  padding: 5px;
  height: 30px;
  width: 100px;
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 12px;
}

.game-ui > img, 
.game-ui > span {
  vertical-align: middle;
}

button {
  padding: 10px 16px;
  margin: 0 4px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: black;
  color: white;
  box-shadow: inset 0 2px 0 gray;
}

button:hover {
  background: white;
  color: black;
  /* box-shadow: inset 0 4px 0 white; */
}

#mainButton {
  background: black;
  color: white;
  box-shadow: inset 0 2px 0 gray;
}

#mainButton:hover {
  background: white;
  color: white;
  /* box-shadow: inset 0 4px 0 white; */
}

#copySeedButton {
  display: none;
}

#copyShareLink {
  display: none;
}

#shinyInput {
  display: none;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 170px;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.custom-checkbox input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  width: 44px;
  height: 22px;
  background-color: #444;
  border-radius: 20px;
  position: relative;
  transition: 0.3s;
  border: 1px solid #666;
  flex-shrink: 0;
}

.slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 4px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.custom-checkbox input:checked + .slider {
  background-color: #00178f;
  border-color: #63c6f5;
}

.custom-checkbox input:checked + .slider:hover {
  border-color: white;
}

.custom-checkbox input:checked + .slider::before {
  transform: translateX(20px);
}

.custom-checkbox:hover .slider {
  border-color: #fff;
}

.tag-filters .label-text {
  white-space: nowrap;
}

.tag-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: fit-content;
}

.tag-checkbox .label-text {
  line-height: 1;
}

.control-row #tagFilters {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 22px;
  justify-content: center;
  max-width: 540px;
}

.board-wrapper {
  position: relative;
}

.board-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 1);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: 10px solid black;
}

.board-overlay.hidden {
  display: none;
}

.overlay-text {
  color: white;
  font-size: 1.5rem;
  text-align: center;
  user-select: none;
}

#board {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
  margin-bottom: 25px;
}

.objective {
  width: 80px;
  height: 80px;
  background: #222;
  border: 2px solid #555;
  border-radius: 10px;
  padding: 5px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 20px;
}

.objective img {
  /* width: 60px;
  height: 60px; */
  object-fit: contain;
  margin-bottom: 5px;

  width: 90%;
  height: 90%;
}

.objective .label {
  font-size: 14px;
  opacity: 0.85;
}

.objective:hover {
  background: #333;
  transform: scale(1.05);
}

.objective.completed {
  background: var(--mark-fill);
  /* border-color: var(--mark-border); */
  color: white;
}

.objective.completed:not(.shiny) {
  border-color: var(--mark-border);
}

.objective.border-mark {
  /* border: 5px solid; */
  /* border-color: var(--mark-border); */
  box-shadow: inset 0 0 0 4px var(--mark-border);
  background: #222;
}

.objective.bingo-line:not(.shiny) {
  background: linear-gradient(135deg, #7b3fe4, #9b59b6);
  border-color: #8e44ad;
  color: white;
}

.objective.bingo-line.shiny {
  background: linear-gradient(135deg, #7b3fe4, #9b59b6);
  color: white;
}

.objective.shiny {
  position: relative;
}

.objective.shiny::before {
  content: "";
  position: absolute;
  inset: -7px;
  background: linear-gradient(
    45deg,
    red,
    orange,
    yellow,
    lime,
    cyan,
    deepskyblue,
    violet,
    red
  );
  filter: blur(2px);
  opacity: 0.6;
  z-index: -1;
  border-radius: 10px;
}

#game-summary {
  text-align: center;
  margin-bottom: 18px;
}

#status {
  margin: 15px;
  font-size: 18px;
}

#log {
  display: none;
  width: 640px;
  max-width: 90%;
  background: #1a1a1a;
  border: 2px solid #444;
  border-radius: 8px;
  padding: 15px;
}

#log h2 {
  margin-top: 0;
  font-size: 20px;
}

#completedList {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#completedList li {
  padding: 6px 0;
  border-bottom: 1px solid #333;
  font-size: 15px;
}

.round {
margin-bottom: 12px;
}

.round-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.chosen {
  color: var(--mark-fill);
}

.not-chosen {
  color: #888;
  text-decoration: line-through;
}

.hidden {
  display: none !important;
}

/* Dropdown styling */
.dropdown {
  padding: 8px 12px;
  font-size: 16px;
  border-radius: 6px;
  /* border: 2px solid #555;
  background-color: #222; */
  border: 2px solid #555;
  background-color: black;
  color: #fff;
  cursor: pointer;
  margin-right: 8px;
  transition: all 0.2s ease;
  outline: none;
}

.dropdown:hover {
  border-color: #3498db;
}

.dropdown:focus {
  border-color: #3498db;
  box-shadow: 0 0 6px #3498db55;
}

/* Optional: style the dropdown arrow for a custom look */
.dropdown::-ms-expand {
  display: none; /* for IE */
}

.dropdown option {
  background-color: #222;
  color: #fff;
  padding: 6px;
}

#progressContainer {
  display: none;
  width: 500px;
  max-width: 90%;
  height: 20px;
  background-color: #222;
  border: 2px solid #555;
  border-radius: 10px;
  margin: 15px 0;
}

#progressBar {
  height: 100%;
  width: 0%;
  background-color: var(--mark-fill);
  border-radius: 8px;
  transition: width 0.3s ease;
}

.mode-options {
  display: none;
  margin-top: 10px;
}

#traditionalOptions {
  gap: 10px;
}

#info.collapsed {
  display: none;
}

#infoContainer {
  width: 640px;
  max-width: 90%;
  margin-bottom: 20px;
}

#info {
  font-family: Arial, sans-serif;;
}

.info-toggle {
  cursor: pointer;
  font-size: 16px;
  color: #aaa;
  list-style: none;
}

.info-toggle::-webkit-details-marker {
  display: none;
}

.info-toggle::before {
  content: "▶ ";
  display: inline-block;
  transition: transform 0.2s ease;
}

details[open] .info-toggle::before {
  transform: rotate(90deg);
}

#tooltip {
  position: absolute;
  visibility: hidden;
  width: 120px;
  background-color: black;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px 0;
  z-index: 9999;
  border: 1px solid white;
  pointer-events: none;
  transition: opacity 0.1s ease-in-out;
  opacity: 0;
}

#tooltip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent white transparent;
}

#listPreview {
  margin-top: 6px;
  padding-bottom: 20px;
  font-size: 14px;
  color: #bbb;
}

#score {
  margin-bottom: 50px;
}

/* ===== Marking Color Themes ===== */
:root {
  --mark-border: #27ae60;
  --mark-fill: #2ecc71;
}

/* Green (default) */
.theme-green {
  --mark-border: #27ae60;
  --mark-fill: #2ecc71;
}

/* Teal */
.theme-teal {
  --mark-border: #16a085;
  --mark-fill: #1abc9c;
}

/* Red */
.theme-red {
  --mark-border: #c0392b;
  --mark-fill: #e74c3c;
}

/* Blue */
.theme-blue {
  --mark-border: #2980b9;
  --mark-fill: #3498db;
}

/* Gold */
.theme-gold {
  --mark-border: #b7950b;
  --mark-fill: #f1c40f;
}

/* Orange */
.theme-orange {
  --mark-border: #d35400;
  --mark-fill: #e67e22;
}

/* =========================
   SRL STYLE OVERRIDE LAYER
   - done by AI
========================= */

/* Global background tweak */
body {
  background: #111;
  color: #bec7d2;
}

/* ===== CONTROL PANELS ===== */
.control-row {
  background: linear-gradient(to bottom, #424242, #303030) !important;
  border: 1px solid #4c4c4c;
  box-shadow: 1px 1px 4px rgba(0,0,0,0.7);
  border-radius: 6px;
}

/* Remove flat colors from sections but keep identity via border */
/* #gameOptions { border-left: 4px solid #f1c40f; }
#modeOptions { border-left: 4px solid #2ecc71; }
#modifiers   { border-left: 4px solid #3498db; } */

/* Headers become SRL-style bars */
.control-headers {
  width: 90%;
  text-align: left;
  background: linear-gradient(to bottom, #3c70df, #235cd4);
  border: 1px solid #102a63;
  color: #fff !important;
  padding: 6px;
  border-radius: 4px;
  font-weight: bold;
  text-shadow: 1px 1px 2px black;
}

/* ===== BUTTONS ===== */
button {
  background: linear-gradient(to bottom, #3c70df, #235cd4) !important;
  border: 1px solid #102a63 !important;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  text-shadow: 1px 1px 2px black;
}

button:hover {
  background: linear-gradient(to bottom, #4e7de2, #2c65e0) !important;
}

button:active {
  background: linear-gradient(to bottom, #1448b3, #103b93) !important;
  box-shadow: none;
}

/* Special main button (slightly gold highlight) */
#mainButton {
  background: linear-gradient(to bottom, #f1c40f, #b7950b) !important;
  border: 1px solid #7d6608 !important;
  color: black !important;
  text-shadow: none;
}

#mainButton:hover {
  color: white !important;
}

/* ===== DROPDOWNS ===== */
.dropdown {
  background: linear-gradient(to bottom, #1e3294, #16257a);
  border: 2px solid #1a2a88;
  color: white;
  font-weight: bold;
}

.dropdown:hover {
  border-color: #4e7de2;
}

/* ===== INPUTS ===== */
input {
  background: #000;
  border: 1px solid #555;
}

/* ===== BOARD ===== */
#board {
  gap: 4px; /* tighter like SRL */
}

/* Tile restyle */
.objective {
  border-radius: 0 !important; /* remove rounded look */
  background: #000;
  border: 1px solid #424242;
  box-shadow: inset 0 0 35px rgba(0,0,0,0.8);
  font-size: 12px;
}

/* Hover = blue glow */
.objective:hover {
  background: #001a36;
  transform: none; /* remove scale pop */
}

/* Completed = darker */
.objective.completed {
  background: var(--mark-fill);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* Border mark = SRL style inset border */
.objective.border-mark {
  box-shadow: inset 0 0 0 3px var(--mark-border);
}

/* Bingo line = more dramatic */
.objective.bingo-line {
  background: linear-gradient(135deg, #7b3fe4, #9b59b6);
}

/* ===== OVERLAY ===== */
.board-overlay {
  background: rgba(0,0,0,1);
  outline: 9px solid black;
}

/* ===== INFO PANEL ===== */
#infoContainer {
  background: #1a1a1a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 10px;
}

/* ===== TOOLTIP ===== */
#tooltip {
  background: #000;
  border: 1px solid #fff;
}

/* ===== FIELD HELP TEXT ===== */
.control-hint {
  font-size: 0.75rem;
  color: var(--text-dimmer, #8991a1);
  margin-top: 4px;
  line-height: 1.2;
  max-width: 260px;
  opacity: 0.85;
}

/* Makes label groups stack cleanly */
/* Only affect standard form labels, not custom UI components */
#gameOptions label,
#modeOptions label,
#modifiers label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ===== FIX TOGGLE ALIGNMENT ===== */
#modeOptions .custom-checkbox,
#modifiers .custom-checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

/* label text stays left column */
.mode-options .custom-checkbox .label-text, #modifiers .custom-checkbox .label-text {
  display: flex;
  flex-direction: column;   /* allow description under text */
  gap: 4px;
  align-items: flex-start;
}

/* keep slider pinned right */
.mode-options .custom-checkbox .slider, #modifiers .custom-checkbox .slider {
  flex-shrink: 0;
  margin-left: auto;
}

/* optional: prevent weird centering from parent label styles */
.mode-options .custom-checkbox label, #modifiers .custom-checkbox label {
  width: 100%;
}

.tag-checkbox {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: auto;
}

#tagFilters label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* Roguelike board cells */
.rogue-cell {
  transition: background 0.2s;
}

.rogue-hidden {
  background: #1a1a2e;
  cursor: default;
  pointer-events: none;
}

/* Red / forced layer tint */
.rogue-red {
  background: rgba(180, 30, 30, 0.35) !important;
  border-color: #c0392b;
}

/* Gold / goal layer tint */
.rogue-goal {
  background: rgba(220, 200, 60, 0.25) !important;
  border-color: #f1c40f;
}

/* Invisible grid spacers */
.rogue-spacer {
  pointer-events: none;
}

.rogue-red,
.rogue-goal {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

.rogue-passed {
  opacity: 0.35;
  filter: grayscale(60%);
  cursor: default;
  pointer-events: none;
}
