:root {
  --bg: #121214;

  --bg3: #242429;
  --text1: #ffffff;

  --border: #2e2e33;

  --code-box: #1a1a1e;
  --code-box-hover: #242429;
  --code-box-active: #2e2e35;

  --btn1: #5865f2;
  --btn-text: #ffffff;
  --btn1-hover: #4654c0;
  --btn1-active: #3a48a3;

  --btn-alert: #d22d39;
  --btn-alert-hover: #b42831;
  --btn-alert-active: #921f27;
}

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

  font-family: "Fira Sans", sans-serif;
  font-weight: 400;
  font-style: normal;

  font-family: "Fira Mono", monospace;
  font-weight: 400;
  font-style: normal;

  font-size: 14px;
  color: var(--text1);
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+/Edge */
  user-select: none; /* Standard */
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background-color: #121212;
  color: var(--text1);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0px;
}

.card {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  background: #1e1e1e;
  padding: 16px 20px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  width: fit-content;
  max-width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.form-row .form-group {
  flex: none;
}

label {
  font-size: 13px;
  margin-bottom: 4px;
  display: block;
  color: #aaa;
}

select,
input[type="text"] {
  padding: 6px 8px;
  font-size: 14px;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  border-radius: 6px;
}

#room  { width: 56px; }
#slot  { width: 80px; }
#sfx   { width: 100px; }
#name  { width: 120px; }

select:disabled {
  background: #333;
  color: #888;
  cursor: not-allowed;
}

.radio-group {
  display: flex;
  gap: 12px;
}

.radio-group input {
  margin-right: 4px;
}

#button-join {
  padding: 6px 16px;
  background-color: var(--btn1);
  color: var(--btn-text);
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

#button-join:hover {
  background-color: var(--btn1-hover);
}

#button-join:active {
  background-color: var(--btn1-active);
}

@media (max-width: 600px) {
  .card {
    flex-wrap: wrap;
    width: 100%;
    padding: 10px;
  }
}

/* ##################################################################### */
.team-container {
  display: none;
}

.donate-container {
  display: none;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  height: 40px;
  width: 100%;
  background-color: var(--bg);
  border: 1px solid #444;
  display: flex;
  align-items: center;
  padding: 0 10px;
  flex-shrink: 0;
}

.room-status {
  display: flex;
  align-items: center;
  padding: 0px 10px;
}

.player-count-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0px 10px;
}

#wheelchair-icon {
  filter: invert(100%) sepia(0%) saturate(1797%) hue-rotate(59deg) brightness(87%) contrast(84%);
  padding-right: 3px;
}

#button-bookmarklet-gen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  transition: background 0.2s;
  background-color: var(--btn1);
}

#button-bookmarklet-gen:hover {
  background-color: var(--btn1-hover);
}

#button-bookmarklet-gen:active {
  background-color: var(--btn1-active);
}

/* Content Area - fill space between navbar and button bar */
.content {
  position: fixed;
  top: 40px;
  left: 0;
  bottom: 60px;

  background-color: var(--bg);

  display: flex;
  flex-wrap: wrap;
  width: 100%;
  overflow: auto; /* optional if you want scroll */
}

/* Horizontal by default */
.copied {
  position: relative;
  overflow: hidden;
}

/* dim content when copied */
.copied .code,
.copied .name,
.copied .datetime {
  opacity: 0.25;
}

/* solid overlay with centered COPIED text */
.copied::after {
  content: "COPIED";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 3px;
  color: #fff;
  pointer-events: none;
}

.content-box {
  display: flex;
  position: relative;

  height: 100%;
  width: 25%;

  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;


  border: 1px solid var(--border);
  background-color: var(--code-box);
  transition: background 0.1s;
}

.content-box:hover {
  background-color: var(--code-box-hover);
}

.content-box:active {
  background-color: var(--code-box-active);
}


.code, .name, .datetime {
  font-size: 14px;
}

/* Vertical layout for small screens */
@media (max-width: 992px) {
  .content {
    flex-direction: column;
  }

  .content-box {
    width: 100%;
    height: 25%;
  }
}


.timestamp {
  display: none;
}

/* Button Bar - pinned to bottom */
.button-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 60px;
  width: 100%;
  display: flex;
  flex-shrink: 0;
}

.send-btn {
  flex: 8;
  /* background-color: #3e8e41; */
  background-color: var(--btn1);
  color: var(--btn-text);
  border: 1px solid #444;
  /* border-radius: 16px; */
  font-size: 14px;
  transition: background 0.2s;
  cursor: pointer;
}

.send-btn:hover {
  background-color: var(--btn1-hover);
}

.send-btn:active {
  background-color: var(--btn1-active);
}

.alert-btn {
  flex: 2;
  background-color: var(--btn-alert);
  color: var(--btn-text);
  border: 1px solid #444;
  /* border-radius: 16px; */
  font-size: 14px;
  transition: background 0.2s;
  cursor: pointer;
}

.alert-btn:hover {
  background-color: var(--btn-alert-hover);
}

.alert-btn:active {
  background-color: var(--btn-alert-active);
}

/* shortkeys modal popup */
.shortkeys-modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6); /* Dim background */
}

.shortkeys-model-content {
  background-color: var(--bg3);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: auto;
  padding: 20px;
  border-radius: 10px;
  width: 80%;
}

/* code block */
.code-container {
  margin: 20px auto;
  padding: 0;
  overflow-x: scroll;
  background-color: #171717;

  border-radius: 8px;
}

.code-container .header {
  position: sticky;
  top: 0;
  left: 0;

  width: 100%;

  /* our button is placed at right side/end of header  */
  display: flex;
  justify-content: end;


}

.code-container .header button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em; /* space between icon and text */
  padding: 5px auto;
  margin: 10px;

  border: none;
  background-color: #171717;
  color: white;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
}

.code-container .header button svg {
  display: inline-block;
  vertical-align: middle;
}

/* ----- delay option on start page ----- */
.delay-group {
  display: flex;
  flex-direction: column;
}

.delay-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.delay-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--btn1);
  flex-shrink: 0;
}

#delay-ms {
  width: 80px;
  padding: 6px 8px;
  font-size: 14px;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  border-radius: 6px;
  transition: opacity 0.2s;
}

.tooltip-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #444;
  color: #ccc;
  font-size: 11px;
  cursor: default;
  flex-shrink: 0;
}

.tooltip-anchor:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s;

  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  width: 220px;

  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: #ccc;
  line-height: 1.5;
  white-space: normal;
  z-index: 100;
  pointer-events: none;
}

/* arrow pointing right toward the ? button */
.tooltip-text::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #444;
}

#delay-ms:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ----- countdown number inside content-box ----- */
.countdown {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  font-weight: bold;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
  transition: opacity 0.15s;
  white-space: nowrap;
  z-index: 1;
}

.content-box.not-ready .countdown {
  opacity: 1;
}

/* dim code, name, datetime when not ready */
.content-box.not-ready .code,
.content-box.not-ready .name,
.content-box.not-ready .datetime {
  opacity: 0.2;
}

/* ----- ready progress bar inside content-box ----- */
.ready-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: transparent;
}

.ready-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--btn1);
  transition: none; /* controlled via JS */
}

/* when slot is "not ready", dim the code slightly */

.content-box.not-ready .ready-bar-fill {
  background: #888;
}

/* ----- shortkeys code block ----- */
.code-container .shortkeys-code-block {
  white-space: nowrap;    /* Prevent line wrapping */
  display: inline-block;  /* Make sure it respects width */
  padding: 0;
  margin: 20px;

  font-family: "Fira Code", monospace;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}
