:root {
    --background-color: #000000;
    --background-color-2:  #000000;
    --highlight: #ffffff;
    --shadow-color: #c0c0c0;

    --button-color: var(--text-color);
  
    /* --game-font: 'Goma'; */
    --game-font: 'SquareAntiqua';

    --font: Arial, sans-serif;
    --font-2: 'Garamond', 'EB Garamond', 'Adobe Garamond Pro', serif;

    --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);
    --primary-light: rgba(12, 11, 95, 0.05);
    --accent-light: rgba(255, 246, 115, 0.3);
  }
  
  /* Back link styling */
  .back-link {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: normal;
    font-family: var(--font);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
  }
  
  .back-link:hover {
    border-bottom-color: var(--primary-color);
  }
  
  /* Text container styling */
  .text {
    display: flex;
    align-items: center;
    height: 100%;
  }
  
  /* Subtitle styling */
  .subtitle {
    margin-left: 15px;
    font-size: 16px;
    font-weight: bold;
    color: var(--primary-color);
    text-transform: uppercase;
    font-family: var(--game-font);
    /* text-shadow: 1px 1px 0px #fff; */
  }
  
  #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: 2px 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;
  }
  
  /* Corpus textarea styling */
  .corpus-textarea {
    width: 100%;
    height: 100px;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    border: 2px solid;
    border-color: var(--border-color) var(--highlight) var(--highlight) var(--border-color);
    background-color: var(--highlight);
    color: var(--background-color);
    padding: 8px;
    box-sizing: border-box;
    resize: vertical;
  }
  
  .corpus-textarea-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--primary-color);
  }
  
  .corpus-textarea-container {
    margin-bottom: 15px;
    width: 100%;
  }
  
  .corpus-controls {
    display: flex;
    gap: 12px;
    margin-top: 16px;
  }
  
  .corpus-textarea {
    width: 100%;
    min-height: 80px;
    font-family: var(--font);
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px;
    font-size: 14px;
    resize: vertical;
    margin-top: 8px;
  }
  
  .corpus-textarea:focus {
    outline: none;
    background-color: var(--primary-color);
    color: var(--accent-color);
  }
  
  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);
  }
  
  /* Modal styles */
  .modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay-color);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .modal-content {
    background-color: var(--background-color);
    border: 2px solid var(--highlight);
    width: 90%;
    overflow: auto;
  }
  
  .modal-header {
    font-family: Garamond, "EB Garamond", "Adobe Garamond Pro", serif;
    background-color: var(--highlight);
    color: var(--background-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .modal-body {
    font-family: Garamond, "EB Garamond", "Adobe Garamond Pro", serif;
    color: var(--text-color);
    padding: 5px;
    gap: 2px;
    font-size: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
  
  .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;
  }
  
  .submit-btn {
    z-index: 1000;
    background-color: var(--highlight) !important;
    color: var(--background-color) !important;
    border: 2px solid var(--highlight) !important;
    width: 10em;
  }

  .submit-btn:hover {
    background-color: var(--background-color) !important;
    color: var(--highlight) !important;
    border: 2px solid var(--highlight) !important;
  }
  
  /* Final poem styling */
  .final-poem {
    font-family: Garamond, "EB Garamond", "Adobe Garamond Pro", serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--primary-color);
    white-space: pre-wrap;
    padding: 20px;
    background-color: var(--accent-light);
    border-left: 3px solid var(--primary-color);
    margin: 10px 0;
  }
  
  /* Control Icons */
  .control-icons {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
    z-index: 1500;
    opacity: 0.6;
    transition: opacity 0.2s ease;
  }
  
  .control-icons.hidden {
    opacity: 0;
    pointer-events: none;
  }
  
  .control-icon-row {
    display: flex;
    gap: 0.5em;
    justify-content: center;
  }
  
  .control-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--highlight);
    border-radius: 0.375em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--accent-color);
  }
  
  .control-icon svg {
    stroke: var(--accent-color);
    width: 1.25rem;
    height: 1.25rem;
  }
  
  .control-icon.spacebar {
    width: 9rem;
  }
  
  .control-icon span {
    font-family: var(--font-2);
    font-size: 0.6rem;
    margin-top: 0.125em;
  }
  