@font-face {
  font-family: "Roboto";
  src: url("/Roboto-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
body {
  background: url(/background.webp) no-repeat fixed;
  background-size: cover;
  background-color: #eee;
  color: #d4d4d4;
  font-family: "Roboto", "Open Sans", sans-serif;
  margin: 0;
}
body.chip8-body {
  background: none;
  background-color: #1e1e1e;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
}

a {
  color: inherit;
  text-decoration: none;
}

.analytics-container {
  display: block;
  width: 95%;
  margin: 20px auto 40px auto;
  max-width: 1000px;
  background-color: #ffffff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 600px) {
  .analytics-container {
    padding: 15px;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    margin-top: 20px;
  }
}
.analytics-container table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.analytics-container table thead th {
  text-align: left;
  padding: 16px;
  color: #888888;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  font-weight: 600;
  border-bottom: 2px solid #f2f2f2;
  white-space: nowrap;
}
.analytics-container table tbody tr {
  transition: background-color 0.2s;
}
.analytics-container table tbody tr:hover {
  background-color: rgb(247.1, 247.1, 247.1);
}
.analytics-container table tbody tr td {
  padding: 14px 16px;
  color: #333333;
  border-bottom: 1px solid #f2f2f2;
  font-size: 0.95rem;
}
.analytics-container table tbody tr td:first-child, .analytics-container table tbody tr td:last-child {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-family: "Fira Code Retina", "Fira Code", "Consolas", "Monaco", monospace;
  font-size: 0.85rem;
}
.analytics-container table tbody tr:last-child td {
  border-bottom: none;
}
.analytics-container table .iso-code {
  text-align: center;
  width: 80px;
}
.analytics-container table .count {
  text-align: right;
  width: 100px;
}
.analytics-container table .ip-address {
  min-width: 200px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .analytics-container table thead th {
    padding: 10px;
    font-size: 0.7rem;
  }
  .analytics-container table tbody td {
    padding: 10px;
    font-size: 0.8rem;
  }
}

.catscii-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 20px auto 40px auto;
  max-width: 1200px;
  padding: 0 20px;
}
@media (max-width: 600px) {
  .catscii-container {
    padding: 0 10px;
    margin: 10px auto 20px auto;
  }
}
.catscii-container .ascii-art {
  font-family: "Fira Code Retina", "Fira Code", "Consolas", "Monaco", monospace;
  font-size: 8px;
  line-height: 8px;
  background-color: #1e1e1e;
  color: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
  overflow: auto;
  max-width: 100%;
  max-height: 80vh;
  border: 1px solid #333333;
}
@media (max-width: 600px) {
  .catscii-container .ascii-art {
    padding: 10px;
    font-size: 6px;
    line-height: 6px;
  }
}
.catscii-container .ascii-art::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.catscii-container .ascii-art::-webkit-scrollbar-track {
  background: #1e1e1e;
}
.catscii-container .ascii-art::-webkit-scrollbar-thumb {
  background: #555555;
  border-radius: 5px;
}
.catscii-container .ascii-art::-webkit-scrollbar-thumb:hover {
  background: #777777;
}

.col-controls .controls-panel .control-row .rom-select, .key {
  background: linear-gradient(145deg, rgb(63.75, 63.75, 63.75), rgb(38.25, 38.25, 38.25));
  border-radius: 6px;
  border: 1px solid rgb(76.5, 76.5, 76.5);
  border-bottom-color: rgb(25.5, 25.5, 25.5);
  box-shadow: 0 4px 0 rgb(12.75, 12.75, 12.75), 0 5px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.1s ease;
  cursor: pointer;
  position: relative;
  top: 0;
  user-select: none;
}

.col-controls .controls-panel .control-row .rom-select:active, .col-controls .controls-panel .control-row .rom-select:focus, .key:active, .key.pressed {
  top: 4px;
  box-shadow: 0 0 0 rgb(12.75, 12.75, 12.75), inset 0 2px 5px rgba(0, 0, 0, 0.4);
  background: #333333;
  border-color: #333333;
  outline: none;
}

.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
}
.key .key-label {
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}
.key .hex-label {
  font-size: 0.7rem;
  color: #888888;
  margin-top: -2px;
}
.key:active, .key.pressed {
  background: #333333;
  background: linear-gradient(145deg, #00cc00, #00ff00);
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.6), inset 0 2px 5px rgba(0, 0, 0, 0.2);
  border: 1px solid #00ff00;
}
.key:active .key-label,
.key:active .hex-label, .key.pressed .key-label,
.key.pressed .hex-label {
  color: #000000;
  text-shadow: none;
}

.debugger-app {
  position: relative;
  flex: 1;
  background: #1e1e1e;
  color: #d4d4d4;
  display: grid;
  font-family: "Fira Code Retina", "Fira Code", "Consolas", "Monaco", monospace;
  height: auto;
  width: 100%;
  overflow: hidden;
}
.debugger-app.mode-debug {
  grid-template-columns: 260px 642px 260px 1fr;
}
@media (max-width: 1200px) {
  .debugger-app.mode-debug {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding-bottom: 40px;
    overflow-y: auto;
  }
  .debugger-app.mode-debug .panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #333333;
    flex: none;
    height: auto;
    min-height: 300px;
  }
  .debugger-app.mode-debug .col-canvas canvas {
    max-width: 100%;
    height: auto;
  }
}
.debugger-app.mode-game {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  padding: 40px;
  overflow-y: auto;
}
@media (max-width: 1024px) {
  .debugger-app.mode-game {
    flex-direction: column;
    align-items: center;
    padding: 20px;
    gap: 20px;
  }
}
.debugger-app.mode-game .panel {
  border: none;
  overflow: visible;
}
.debugger-app.mode-game .col-canvas {
  flex: 1;
  width: auto;
  min-width: 0;
  display: flex;
  justify-content: center;
}
.debugger-app.mode-game .col-canvas .screen-wrapper {
  background: transparent;
  padding: 0;
}
.debugger-app.mode-game .col-canvas .screen-wrapper canvas {
  width: 960px;
  height: 480px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 2/1;
  image-rendering: pixelated;
  border-radius: 4px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  border: 4px solid #222;
}
.debugger-app.mode-game .col-canvas .divider {
  display: none;
}
.debugger-app.mode-game .col-controls {
  flex: 0 0 320px;
  background: rgba(34, 34, 34, 0.5);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #333333;
  backdrop-filter: blur(10px);
}
@media (max-width: 1024px) {
  .debugger-app.mode-game .col-controls {
    width: 100%;
    flex: none;
    order: 3;
  }
}
.debugger-app.mode-game .col-controls .panel-header {
  background: transparent;
  border: none;
  padding-left: 0;
  font-size: 14px;
  margin-bottom: 4px;
  color: #d4d4d4;
}
.debugger-app.mode-game .col-controls .divider {
  display: none;
}

.panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #333333;
  overflow: hidden;
  padding: 0;
}
.panel:last-child {
  border-right: none;
}

.panel-header {
  background-color: #252526;
  color: #ffffff;
  padding: 6px 10px;
  font-weight: bold;
  border-bottom: 1px solid #333333;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.divider {
  border: 0;
  border-top: 1px solid #333333;
  margin: 0;
}

.col-state {
  padding: 10px;
  overflow-y: auto;
}
.col-state .emulator-info-panel .info-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 4px 10px;
  padding: 5px 0;
  font-size: 12px;
}
.col-state .emulator-info-panel .info-grid dt {
  color: #888888;
  text-align: right;
  margin: 0;
}
.col-state .emulator-info-panel .info-grid dd {
  margin: 0;
  color: #d4d4d4;
}
.col-state .emulator-info-panel .info-grid .rom-name {
  color: #569cd6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-state .emulator-info-panel .info-grid .state-running {
  color: #4ec9b0;
}
.col-state .emulator-info-panel .info-grid .state-stopped {
  color: #f44747;
}
.col-state .emulator-info-panel .info-grid .audio-beep {
  color: #ce9178;
  font-weight: bold;
}
.col-state .emulator-info-panel .info-grid .audio-ok {
  color: #6a9955;
}
.col-state .cpu-state-panel {
  padding-top: 10px;
  font-size: 13px;
}
.col-state .cpu-state-panel .grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.col-state .cpu-state-panel .grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.col-state .cpu-state-panel .grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 4px;
  margin-top: 10px;
}
.col-state .cpu-state-panel .reg-cell {
  display: flex;
  flex-direction: column;
}
.col-state .cpu-state-panel .reg-cell .lbl {
  color: #888888;
  font-size: 11px;
  margin-bottom: 2px;
}
.col-state .cpu-state-panel .reg-cell .val {
  color: #569cd6;
  font-weight: bold;
}
.col-state .cpu-state-panel .reg-cell .dec {
  color: #888888;
  font-size: 11px;
}
.col-state .stack-viewer {
  margin-top: 10px;
  border: 1px solid #333333;
  background: rgba(0, 0, 0, 0.2);
}
.col-state .stack-viewer .stack-grid {
  display: grid;
  grid-template-columns: 1fr;
  font-size: 11px;
  max-height: 200px;
  overflow-y: auto;
}
.col-state .stack-viewer .stack-grid .stack-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  padding: 2px 8px;
  border-bottom: 1px solid #222222;
}
.col-state .stack-viewer .stack-grid .stack-row .idx {
  color: #666;
  font-weight: bold;
  text-align: right;
  padding-right: 8px;
  border-right: 1px solid #333333;
}
.col-state .stack-viewer .stack-grid .stack-row .val {
  color: #555;
  padding-left: 8px;
  font-family: monospace;
}
.col-state .stack-viewer .stack-grid .stack-row.row-stored {
  background: rgba(78, 201, 176, 0.05);
}
.col-state .stack-viewer .stack-grid .stack-row.row-stored .idx {
  color: #4ec9b0;
}
.col-state .stack-viewer .stack-grid .stack-row.row-stored .val {
  color: #eee;
}
.col-state .stack-viewer .stack-grid .stack-row.row-sp {
  background: rgba(206, 145, 120, 0.1);
}
.col-state .stack-viewer .stack-grid .stack-row.row-sp .idx {
  color: #ce9178;
}
.col-state .stack-viewer .stack-grid .stack-row.row-sp .val {
  color: #ce9178;
  font-style: italic;
}

.col-controls {
  overflow-y: auto;
}
.col-controls .controls-panel {
  padding: 5px 10px;
}
.col-controls .controls-panel .control-row {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.col-controls .controls-panel .control-row .rom-select {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 14px;
  text-align: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
}
.col-controls .controls-panel .control-row .rom-select:hover {
  background: linear-gradient(145deg, rgb(76.5, 76.5, 76.5), #333333);
}
.col-controls .controls-panel .control-row .rom-select option {
  background: #1e1e1e;
  color: #ffffff;
  padding: 8px;
}
.col-controls .controls-panel .control-row .debug-label {
  color: #d4d4d4;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.col-controls .controls-panel .control-row .debug-label input {
  margin-right: 8px;
  accent-color: #569cd6;
  cursor: pointer;
}
.col-controls .controls-panel .control-row .debug-label:hover {
  color: #ffffff;
}
.col-controls .controls-panel {
  padding: 6px;
  background: #333333;
  color: #d4d4d4;
  border: 1px solid #333333;
  cursor: pointer;
}
.col-controls .controls-panel:hover {
  background: #333333;
}
.col-controls .controls-panel.active {
  border-left: 3px solid #4ec9b0;
}
.col-controls .controls-panel .button-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 5px 0;
}
.col-controls .controls-panel .btn-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid #333333;
  border-radius: 6px;
  color: #d4d4d4;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 13px;
}
.col-controls .controls-panel .btn-control:hover:not(:disabled) {
  background: #222222;
  border-color: #ffffff;
  color: #ffffff;
  transform: translateX(2px);
}
.col-controls .controls-panel .btn-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.col-controls .controls-panel .btn-control.btn-danger {
  border-color: rgba(244, 71, 71, 0.5);
  color: #f44747;
}
.col-controls .controls-panel .btn-control.btn-danger:hover {
  background: rgba(244, 71, 71, 0.1);
  border-color: #f44747;
}
.col-controls .controls-panel .btn-control.active {
  border-color: #4ec9b0;
  color: #4ec9b0;
  background: rgba(78, 201, 176, 0.05);
}
.col-controls .controls-panel .btn-control.active:hover {
  background: rgba(78, 201, 176, 0.1);
}

.quirks-panel {
  padding: 10px;
}
.quirks-panel .settings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 5px 0;
}
.quirks-panel .settings-list .checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #d4d4d4;
  cursor: pointer;
  user-select: none;
}
.quirks-panel .settings-list .checkbox-row:hover {
  color: #ffffff;
}
.quirks-panel .settings-list .checkbox-row input {
  margin: 0;
  cursor: pointer;
  accent-color: #569cd6;
}
.quirks-panel .settings-list .checkbox-row label {
  cursor: pointer;
  flex: 1;
}

.colors-panel {
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
}
.colors-panel label {
  cursor: pointer;
  font-size: 11px;
  color: #d4d4d4;
}
.colors-panel .picker-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.colors-panel .picker-wrapper input[type=color] {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
}
.colors-panel .picker-wrapper input[type=color]::-webkit-color-swatch-wrapper {
  padding: 0;
}
.colors-panel .picker-wrapper input[type=color]::-webkit-color-swatch {
  border: 1px solid #333333;
  border-radius: 2px;
}
.colors-panel .picker-wrapper .hex-label {
  font-family: "Consolas", monospace;
  font-size: 10px;
  color: #888888;
  width: 50px;
  text-align: right;
}

.col-canvas .screen-wrapper {
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0px;
}
.col-canvas .screen-wrapper canvas {
  border: 1px solid #333333;
  display: block;
}
.col-canvas .memory-wrapper {
  overflow: hidden;
}
.col-canvas .memory-wrapper .memory-viewer {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.col-canvas .memory-wrapper .memory-viewer .memory-content {
  flex: 1;
  overflow-y: auto;
  font-size: 12px;
  padding: 5px 0;
}
.col-canvas .memory-wrapper .memory-viewer .memory-content .memory-row {
  display: grid;
  grid-template-columns: 60px max-content max-content;
  gap: 10px;
  white-space: nowrap;
  padding: 2px 10px;
}
.col-canvas .memory-wrapper .memory-viewer .memory-content .memory-row:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.col-canvas .memory-wrapper .memory-viewer .memory-content .memory-row.active {
  background-color: #264f78;
  color: #ffffff;
}
.col-canvas .memory-wrapper .memory-viewer .memory-content .memory-row.active .addr {
  color: #ffffff;
}
.col-canvas .memory-wrapper .memory-viewer .memory-content .memory-row .addr {
  color: #569cd6;
}
.col-canvas .memory-wrapper .memory-viewer .memory-content .memory-row .hex {
  color: #ce9178;
  letter-spacing: 1px;
}
.col-canvas .memory-wrapper .memory-viewer .memory-content .memory-row .ascii {
  color: #d4d4d4;
  opacity: 0.8;
}

.col-disassembly .disassembler-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.col-disassembly .disassembler-panel .code-window {
  flex: 1;
  overflow: auto;
  padding: 5px 0;
}
.col-disassembly .disassembler-panel .code-window .code-row {
  display: grid;
  grid-template-columns: 60px 80px 1fr;
  padding: 2px 8px;
  cursor: default;
  border-left: 3px solid transparent;
  white-space: nowrap;
}
.col-disassembly .disassembler-panel .code-window .code-row:hover {
  background-color: rgba(255, 255, 255, 0.05);
}
.col-disassembly .disassembler-panel .code-window .code-row.active {
  background-color: #264f78;
  border-left-color: #569cd6;
  opacity: 1;
}
.col-disassembly .disassembler-panel .code-window .code-row .addr {
  color: #569cd6;
}
.col-disassembly .disassembler-panel .code-window .code-row .hex {
  color: #ce9178;
}

.chip8-instructions {
  margin-top: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #d4d4d4;
}
@media (max-width: 1024px) {
  .chip8-instructions {
    margin-top: 10px;
    margin-bottom: 10px;
    width: 100%;
  }
}

.key-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background: #222222;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #333333;
}
@media (max-width: 1024px) {
  .key-grid {
    gap: 6px;
    padding: 6px;
    width: 100%;
    max-width: 400px;
  }
}

.life-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 20px auto 40px auto;
  max-width: 900px;
  padding: 0 20px;
}
.life-container .life-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffffff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  width: 100%;
  gap: 24px;
}
@media (max-width: 600px) {
  .life-container .life-area {
    padding: 20px;
    gap: 16px;
  }
}
.life-container .life-area .game-of-life {
  display: flex;
  justify-content: center;
  width: 100%;
}
.life-container .life-area .game-of-life canvas {
  border-radius: 8px;
  box-shadow: inset -4px 7px 7px -3px rgba(0, 0, 0, 0.36);
  border: 1px solid #d4d4d4;
  cursor: crosshair;
  max-width: 100%;
  height: auto;
}
.life-container .life-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
@media (max-width: 480px) {
  .life-container .life-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
}
.life-container .life-buttons .game-button {
  background-color: #F03E3E;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: -4px 7px 9px -1px rgba(0, 0, 0, 0.36);
}
.life-container .life-buttons .game-button:hover {
  background-color: #bd3232;
  box-shadow: 0px 15px 20px rgba(46, 229, 157, 0.4);
  transform: translateY(-2px);
}
.life-container .life-buttons .game-button:active {
  transform: translateY(0);
}
.life-container .life-instructions {
  text-align: left;
  color: #1e1e1e;
  background-color: #f2f2f2;
  padding: 16px 24px;
  border-radius: 8px;
  width: 100%;
  font-size: 0.9rem;
}
.life-container .life-instructions ul {
  margin: 0;
  padding-left: 20px;
}
.life-container .life-instructions ul li {
  margin-bottom: 6px;
  font-family: "Fira Code Retina", "Fira Code", "Consolas", "Monaco", monospace;
}

.mandelbrot-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 20px auto 40px auto;
  max-width: 900px;
  padding: 0 20px;
}
.mandelbrot-container .mandelbrot-viewer {
  display: flex;
  justify-content: center;
  width: 100%;
  background-color: #ffffff;
  padding: clamp(10px, 4vw, 30px);
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  overflow: auto;
}
.mandelbrot-container .mandelbrot-viewer canvas {
  border-radius: 8px;
  box-shadow: inset -4px 7px 7px -3px rgba(0, 0, 0, 0.36);
  border: 1px solid #d4d4d4;
  max-width: 100%;
  height: auto;
}
.mandelbrot-container .mandelbrot-caption {
  margin-top: 24px;
  font-size: 1.1rem;
  color: #d4d4d4;
  text-align: center;
  max-width: 700px;
  line-height: 1.5;
  font-style: italic;
}
.mandelbrot-container .mandelbrot-footer {
  margin-top: 40px;
  font-size: 0.9rem;
}
.mandelbrot-container .mandelbrot-footer a {
  color: #569cd6;
  text-decoration: none;
}
.mandelbrot-container .mandelbrot-footer a:hover {
  text-decoration: underline;
}

.blindness-selector {
  margin: 20px 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}
.blindness-selector input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.blindness-selector label {
  background: rgba(136, 136, 136, 0.17);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  font: normal normal 16px/22px "Roboto", "Open Sans", sans-serif;
  padding: 14px 28px;
  text-align: center;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid transparent;
  transition: all 0.2s ease;
}
.blindness-selector label:hover {
  background: rgba(136, 136, 136, 0.25);
  color: #ffffff;
}
.blindness-selector input:checked + label {
  border-color: #ffffff;
  color: #ffffff;
  font-weight: bold;
  background: rgba(136, 136, 136, 0.3);
}

.description {
  color: #ffffff;
  text-align: center;
  margin: 0 auto 40px auto;
  font-size: 1.2em;
  line-height: 1.5;
  max-width: 600px;
}
.description a {
  color: #569cd6;
  text-decoration: none;
}
.description a:hover {
  text-decoration: underline;
}

.entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  margin-bottom: 40px;
}
.entry input {
  padding: 12px 16px;
  border-radius: 11px;
  border: none;
  background-color: #ffffff;
  color: #000000;
  font-size: 1rem;
  width: 100%;
  max-width: 560px;
  box-shadow: inset -4px 7px 7px -3px rgba(0, 0, 0, 0.36);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.entry input:focus {
  outline: none;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
.entry button {
  padding: 12px 17px;
  border-radius: 11px;
  border: none;
  background-color: #F03E3E;
  opacity: 0.75;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease 0s;
  box-shadow: -4px 7px 9px -1px rgba(0, 0, 0, 0.36);
  text-transform: none;
}
.entry button:hover {
  background-color: #bd3232;
  box-shadow: 0px 15px 20px rgba(46, 229, 157, 0.4);
  color: #ffffff;
  transform: translateY(-2px);
}

.readout {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}
.readout canvas {
  border: 1px solid #ffffff;
  box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
  max-width: 100%;
  height: auto;
}

.footnote {
  margin-top: 40px;
  color: #d4d4d4;
  font-size: 0.8em;
}
.footnote a {
  color: #0000EE;
  text-decoration: none;
}
.footnote a:hover {
  text-decoration: underline;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px;
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}
.nav .nav-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.nav .nav-item:hover {
  transform: scale(1.05);
}
.nav .nav-item:hover h3 {
  color: #4ec9b0;
}
.nav .nav-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.nav .nav-item img {
  width: 125px;
  height: 125px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
}
.nav .nav-item h3 {
  margin-top: 12px;
  font-size: 1.1rem;
  color: #ffffff;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.global-nav {
  width: 100%;
  padding: 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.global-nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.global-nav a:hover {
  opacity: 1;
  text-decoration: underline;
}
.global-nav .separator {
  color: #ffffff;
  opacity: 0.3;
  font-weight: bold;
}
.global-nav .current-page {
  color: #ffffff;
  opacity: 1;
  font-weight: bold;
  text-transform: capitalize;
}
.global-nav.chip8-nav {
  padding: 10px 20px;
  background: #1e1e1e;
  margin-bottom: 0;
  justify-content: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.global-nav.chip8-nav a {
  color: #ffffff;
  opacity: 0.8;
}
.global-nav.chip8-nav a:hover {
  opacity: 1;
  color: #4ec9b0;
}
.global-nav.chip8-nav .separator {
  opacity: 0.5;
}

html {
  box-sizing: border-box;
  font-size: 16px;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

html,
body,
#root {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.root {
  display: flex;
  min-height: 100vh;
}

.main-panel {
  position: relative;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  padding: 0 20px;
  box-sizing: border-box;
}
.main-panel.chip8-mode {
  padding: 0;
  background: #1e1e1e;
}

.header {
  color: #ffffff;
  font-family: "Roboto", "Open Sans", sans-serif;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.5px;
  opacity: 1;
  text-align: center;
  width: 100%;
  margin-top: 40px;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
@media (max-width: 600px) {
  .header {
    font-size: 1.25rem;
    margin-top: 20px;
    margin-bottom: 15px;
  }
}

.home-intro {
  color: #ffffff;
  font-family: "Roboto", "Open Sans", sans-serif;
  font-size: 1.5rem;
  font-weight: 400;
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px auto;
  line-height: 1.6;
  opacity: 0.8;
}
@media (max-width: 600px) {
  .home-intro {
    font-size: 1.1rem;
    margin-bottom: 40px;
    padding: 0 20px;
  }
}

.app-footer {
  padding: 20px;
  text-align: center;
  color: #ffffff;
}
.app-footer a {
  text-decoration: underline;
}
