:root {
    /* Fonts */
    --game-font: 'SquareAntiqua';
    --font: Arial, sans-serif;
    --font-2: 'Garamond', 'EB Garamond', 'Adobe Garamond Pro', serif;
    /* --ui-font-size: 100px; */
}

/* Dark mode (default) */
:root,
:root[data-theme="light"] {
    --background-color: #ffffff;
    --background-color-2: #ffffff;
    --text-color: #000000;
    --text-color-2: #ffffff;
    --primary-color: #000000;
    --accent-color: #000000;
    --inline-color: #d09500;
    --delete-color: #a8280e;
    --border-color: #ffffff;
    --modal-overlay-color: rgba(255, 255, 255, 0.5);
    --highlight: rgba(0, 0, 0, 0.153);
    --shadow-color: #404040;
    --button-color: #000000;
    --primary-light: rgba(243, 244, 160, 0.05);
    --primary-muted: color-mix(in srgb, var(--primary-color) 75%, transparent);
    --accent-light: rgba(10, 9, 140, 0.3);
}


:root[data-theme="dark"] {
  --background-color: #000000;
  --background-color-2: #000000;
  --text-color: #ffffff;
  --text-color-2: #000000;
  --primary-color: #ffffff;
  --accent-color: #ffffff;
  --inline-color: #d09500;
  --delete-color: #a8280e;
  --border-color: #000000;
  --modal-overlay-color: rgba(0, 0, 0, 0.5);
  --highlight: rgba(255, 255, 255, 0.153);
  --shadow-color: #c0c0c0;
  --button-color: #ffffff;
  --primary-light: rgba(12, 11, 95, 0.05);
  --primary-muted: color-mix(in srgb, var(--primary-color) 75%, transparent);
  --accent-light: rgba(255, 246, 115, 0.3);
}

  
  #background {
    z-index: 1000;
    pointer-events: none;
    /* background-color: #FFDCACFF; */
    background-color: var(--accent-color);
    position: absolute;
    border-radius: 0.5em;
    box-shadow: 4px 4px 0px var(--shadow-color);
  }
  
  .current-highlight { /* the active column */
    position: absolute;
    left: var(--col-left);
    top: var(--col-top);
    background-color: var(--col-color);
    transition: left 0.2s ease-in-out, top 0.2s ease-in-out;
    border-radius: 0.4em;
    transition: background-color 0.1s step-end;
    z-index: 1002 !important;
    animation: pulse-margin 2s ease-in infinite forwards;
    transition: scale 0.2s ease-in-out;
  }
  
  @keyframes pulse-margin {
    0% {
      transform: scale(1);
    }
    20% {
      transform: scale(1);
    }
    25% {
      transform: scale(1.1);
    }
    75% {
      transform: scale(1.1);
    }
    80% {
      transform: scale(1);
    }
    100% {
      transform: scale(1);
    }
  }
  
  .inline-word {
    color: var(--inline-color);
    background-color: transparent;
    display: inline-block;
  }
  
  .current-markup {
    position: absolute;
    bottom: -48px;
    left: 50%;
    transform: translateX(-50%);
    color: inherit;
    pointer-events: none;
  }

  .remove {
    animation: remove var(--rotate-time) ease-in-out forwards;
    transform-origin: bottom center;
  }

  @keyframes remove {
    0% {
      transform: rotateX(0deg);
    }
    100% {
      transform: rotateX(90deg);
    }
  }

  .add {
    /* animation: add var(--rotate-time) ease-in-out forwards; */
    /* transform-origin: bottom center; */
  }

  @keyframes add {
    0% {
      transform: rotateX(90deg);
    }
    100% {
      transform: rotateX(0deg);
    }
  }
  
  .delete {
    color: transparent;
    /* color: var(--data-color); */
  }
  
  .delete:after {
    content: 'DELETE';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    color: var(--delete-color);
    font-size: 12px;
    font-weight: bold;
  }
  
  .move {
    position: absolute;
    font-family: var(--game-font);
    pointer-events: none;
    z-index: 1001;
  }
  
  /* Default input and dropdown styles */
  input, select, .dropdown {
    font-family: var(--font);
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s, color 0.2s;
  }
  
  input:hover, select:hover, .dropdown:hover {
    background-color: var(--primary-light);
  }
  
  input:focus, select:focus, .dropdown:focus {
    background-color: var(--primary-color);
    color: var(--accent-color);
  }
  
  input option, select option, .dropdown option {
    background-color: var(--accent-color);
    color: var(--primary-color);
  }
  
  /* Default label and checkbox styling */
  label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    }
  
  input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
  }
  
  /* Make dropdown and checkbox appear on same line */
  .option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
  }
  
  .option select, .option input, .option .dropdown {
    font-family: var(--font);
    font-size: 10px;
    padding: 2px 6px;
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    cursor: pointer;
  }
  
  .option label {
    font-family: var(--font);
    font-size: 10px;
    color: var(--primary-color);
  }
  
  .option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-left: 2px solid var(--text-color);
    margin-left: 8px;
  }
  
  .option-group label {
    font-family: var(--font);
    color: var(--text-color);
    font-size: 16px;
  }
  
  .option-group select {
    font-family: var(--font);
    background-color: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    padding: 8px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    outline: none;
    transition: all 0.2s ease;
  }
  
  .option-group select:focus {
    background-color: var(--highlight);
    color: var(--text-color-2);
  }
  
  .option-description {
    font-family: Garamond, "EB Garamond", "Adobe Garamond Pro", serif;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    margin: 4px 0 0 0;
    opacity: 0.8;
    max-width: 90%;
  }
  
  .modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
  }
  
  .close-btn {
    background: none;
    border: none;
    color: var(--background-color);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font);
    transition: transform 0.2s;
  }
  
  .close-btn:hover {
    transform: scale(1.2);
  }
  
  .modal-body {
    padding: 15px;
  }
  
  .modal-body label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
  }
  
  .modal-body textarea {
    width: 100%;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    border: 2px solid var(--highlight);
    background-color: var(--highlight);
    color: var(--background-color);
    padding: 8px;
    box-sizing: border-box;
    resize: vertical;
  }
  
  .modal-body h4 {
    font-family: var(--font);
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
  }
  
  .modal-body p {
    font-size: 14px;
    margin-top: 2px;
    margin-bottom: 2px;
  }
  
  .modal-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--highlight);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
  }
  

  #editor.text-hidden {
    color: transparent;
    caret-color: var(--text-color);
  }

  #overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    padding: 1in;
    box-sizing: border-box;
    pointer-events: none;
  }

  .word-overlay {
    font-family: var(--game-font);
    color: var(--text-color);
  }