html {
  touch-action: manipulation;
}

body {
  margin: 0;
  background: #1e1e1e;
  font-family: 'Press Start 2P', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  color: #000;
  touch-action: manipulation;
}

.shell {
  background: linear-gradient(145deg, #3a3a3a, #1e1e1e);
  border: 8px solid #555;
  border-radius: 20px;
  padding: 20px;
  box-shadow:
    inset 0 0 10px #000,
    0 10px 20px rgba(0, 0, 0, 0.5);
  max-width: 320px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.canvas-wrapper {
  pointer-events: none;           /* block all interaction */
  user-select: none;              /* no text/image selection */
  -webkit-user-select: none;
  -webkit-touch-callout: none;    /* disable touch context menu */
  touch-action: none;             /* disable zoom, pan, etc. */
}

canvas {
  /* background: #a3d5a1; */
  background: #fff;
  border: 6px inset #000;
  box-shadow: inset 0 0 8px #000;
  image-rendering: pixelated;
}

h1.logo {
  font-size: 16px;
  color: #ffffff;
  margin: 0 0 10px;
  text-shadow: 1px 1px #000;
}

.score {
  color: #ffffff;
  margin: 8px 8px !important;
  text-align: center;
}

.lcd-text {
  background: #a3d5a1;
  color: #000;
  font-size: 10px;
  padding: 8px 12px;
  border: 2px inset #444;
  border-radius: 6px;
  text-align: center;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 0.5px;
  width: fit-content;
}


.lcd-text::after {
  content: '';
  display: block;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(0, 0, 0, 0.06) 50%, transparent 50%);
  background-size: 100% 2px;
  z-index: 1;
}

.controls {
  display: flex;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  flex-direction: row;
  margin: 10px 0;
}

button {
  -webkit-user-select: none;
  /* Safari */
  -ms-user-select: none;
  /* IE10+/Edge */
  user-select: none;
  /* Standard */
  -webkit-touch-callout: none;
  /* iOS long-press menu */
  touch-action: manipulation;
  /* Prevents zoom and delays */
}

.button-wrap {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
}

.button-wrap-br {
  display: inline;
  align-items: center;
}

.button-wrap span {
  font-size: 0.6em;
  color: #ccc;
  font-family: 'Press Start 2P', monospace;
  text-align: center;
  line-height: 1;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, 60px);
  /* 4 equal columns */
  grid-auto-rows: auto;
  justify-content: center;
  gap: 10px 10px;
  /* row gap, column gap */
  margin: 10px 0;
}


.controls button {
  background: #ff5050;
  color: white;
  font-size: 16px;
  border: 2px solid #222;
  border-radius: 50%;
  /* ← makes it circular */
  width: 50px;
  height: 50px;
  padding: 0;
  /* ← prevents overflow */
  font-family: 'Press Start 2P', monospace;
  text-shadow: 1px 1px #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.controls button:active {
  background: #cc0000;
  transform: translateY(2px);
}

.rotate-wrap {
  grid-column: span 1;
}

.rotate-pair {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
}

.rotate-buttons {
  display: flex;
  gap: 10px;
}

.rotate-label {
  font-size: 0.6em;
  color: #ccc;
  font-family: 'Press Start 2P', monospace;
  text-align: center;
  line-height: 1;
}

.pause-button {
  background: #ff5050;
  color: white;
  font-size: 16px;
  border: 2px solid #222;
  border-radius: 50%;
  /* ← makes it circular */
  width: 50px;
  height: 50px;
  padding: 0px 0px;
  /* ← prevents overflow */
  margin: 8px 8px;
  /* ← prevents overflow */
  font-family: 'Press Start 2P', monospace;
  text-shadow: 1px 1px #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-button {
  background: #ff5050;
  color: white;
  font-size: 16px;
  border: 2px solid #222;
  border-radius: 50%;
  /* ← makes it circular */
  width: 45px;
  height: 45px;
  padding: 0px 0px;
  /* ← prevents overflow */
  margin: 8px 8px;
  /* ← prevents overflow */
  font-family: 'Press Start 2P', monospace;
  text-shadow: 1px 1px #000;
  display: inline;
  align-items: center;
}

.controls-button {
  background: #ff5050;
  color: white;
  font-size: 16px;
  border: 2px solid #222;
  border-radius: 50%;
  /* ← makes it circular */
  width: 35px;
  height: 35px;
  padding: 0px 0px;
  /* ← prevents overflow */
  margin: 8px 8px;
  /* ← prevents overflow */
  font-family: 'Press Start 2P', monospace;
  text-shadow: 1px 1px #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.votd-box {
  margin-top: 8px;
  text-align: center;
  color: #fff;
  white-space: pre-line;
}

.footer {
  position: fixed;
  bottom: 5px;
  left: 10px;
  font-size: 0.9em;
  color: #888;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .footer {
    display: none;
  }
}

/* Hide controls on desktop by default
.controls {
  display: none;
}

/* Show controls only on small screens (mobile) */
/* @media (max-width: 768px) { */
/* .controls {
    display: flex;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
} */

.verse {
  white-space: pre-line;
}

.top-right {
  position: fixed;
  top: 5px;
  right: 10px;
}

.top-left {
  position: fixed;
  top: 5px;
  left: 10px;
}

.bottom-right {
  position: fixed;
  bottom: 5px;
  right: 10px;
}

.bottom-left {
  position: fixed;
  bottom: 5px;
  left: 10px;
}

.controls-info {
  background: #222;
  color: #fff;
  padding: 20px;
  margin-top: 18px;
  max-width: 300px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  font-size: 16px;
}

.control-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  font-size: small;
  /* white-space: pre-line; */
}

@media (max-width: 768px) {
  .control-group {
    display: none;
    /* grid-template-columns: 1fr 1fr; */
  }
}

.paused-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.hidden {
  display: none;
}

.next-box {
  margin-bottom: 10px;
  text-align: center;
}

#next {
  background: #a3d5a1;
  border: 4px inset #000;
  box-shadow: inset 0 0 6px #000;
  image-rendering: pixelated;
  margin-top: 5px;
}

.high-scores-info {
  background: #222;
  color: #fff;
  padding: 20px;
  margin-top: 18px;
  max-width: 300px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
  font-size: 16px;
}

.high-scores-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  font-size: small;
  /* white-space: pre-line; */
}

.high-scores-box {
  margin-top: 20px;
  padding: 12px;
  width: 100%;
  box-sizing: border-box;
}

.high-scores-title {
  font-size: 10px;
  margin-bottom: 10px;
  color: #000;
  text-align: center;
}

.high-scores-list {
  list-style: decimal;
  padding-left: 20px;
  margin: 0;
  font-size: 8px;
  color: #000;
  text-align: left;
}

.collapsible {
  background: #222;
  color: #fff;
  padding: 10px;
  border-radius: 10px;
  max-width: none;
  /* max-width: 250px; */
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
  font-size: 14px;
  height: auto;
  max-height: none;
  overflow: hidden;
}

.collapsible summary {
  cursor: pointer;
  font-weight: normal;
  list-style: none;
}

.collapsible[open] {
  background-color: #333;
}

.collapsible .content {
  margin-top: 10px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal-content {
  background: black;
  color: white;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  font-family: 'Press Start 2P', monospace;
}

.modal-content input {
  width: 80%;
  padding: 8px;
  margin-top: 10px;
  margin-bottom: 10px;
  font-size: 14px;
}

.modal-content button {
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
}

.hidden {
  display: none;
}