/* Global resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* -------------------- Language Selector -------------------- */
.language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  display: flex;
  gap: 10px;
}

.flag {
  font-size: 1rem;
  font-weight: normal;
  cursor: pointer;
  background-color: #fff;
  border: 2px solid #111;
  border-radius: 8px;
  font-family: var(--typewriter-font);
  color: #111;
  -webkit-appearance: none;
  padding: 0.3rem 0.6rem;
  display: inline-block;
  transition: all 0.3s ease;
  width: auto;
  height: auto;
}

.flag:hover {
  background-color: #ccc;
}

.flag.active {
  background-color: #ccc;
  transform: none;
  box-shadow: none;
  opacity: 1;
}

/* Define global font family */
:root {
  --typewriter-font: Consolas, "Courier New", monospace;
}

/* Body styling: retro grayscale */
body {
  font-family: var(--typewriter-font);
  background-color: #e0e0e0;
  color: #111;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1), color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  will-change: background-color, color;
}

/* Animated background */
.screen.active#home-screen::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    /* Mountains - using triangles */
    linear-gradient(transparent 70%, #999 70%, #999 75%, #777 75%, #777 80%, #555 80%, #555 85%, #333 85%) no-repeat bottom,
    /* Sky gradient */
    linear-gradient(#e0e0e0, #d0d0d0);
  z-index: -2;
}

/* Flying birds */
@keyframes flyBird {
  0% { transform: translate(-100vw, 0); }
  100% { transform: translate(100vw, -20px); }
}

.screen.active#home-screen::after {
  content: '';
  position: fixed;
  top: 15%;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    /* Bird 1 */
    radial-gradient(circle at center, #555 40%, transparent 40%) 20% 0 / 4px 4px no-repeat,
    radial-gradient(circle at center, #555 40%, transparent 40%) 22% 1% / 4px 4px no-repeat,
    radial-gradient(circle at center, #555 40%, transparent 40%) 24% 0 / 4px 4px no-repeat,
    /* Bird 2 */
    radial-gradient(circle at center, #555 40%, transparent 40%) 40% 5% / 4px 4px no-repeat,
    radial-gradient(circle at center, #555 40%, transparent 40%) 42% 6% / 4px 4px no-repeat,
    radial-gradient(circle at center, #555 40%, transparent 40%) 44% 5% / 4px 4px no-repeat,
    /* Bird 3 */
    radial-gradient(circle at center, #555 40%, transparent 40%) 60% 8% / 4px 4px no-repeat,
    radial-gradient(circle at center, #555 40%, transparent 40%) 62% 9% / 4px 4px no-repeat,
    radial-gradient(circle at center, #555 40%, transparent 40%) 64% 8% / 4px 4px no-repeat;
  animation: flyBird 20s linear infinite;
  z-index: -1;
}

/* Pixelated clouds */
@keyframes floatCloud {
  from { transform: translateX(-100%); }
  to { transform: translateX(100vw); }
}

.screen.active#home-screen .clouds {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.cloud {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  box-shadow:
    /* Main cloud shape - pixelated, even bigger size */
    16px 0 0 0 #fff,
    32px 0 0 0 #eee,
    48px 0 0 0 #fff,
    0 16px 0 0 #fff,
    16px 16px 0 0 #fff,
    32px 16px 0 0 #fff,
    48px 16px 0 0 #fff,
    64px 16px 0 0 #fff,
    16px 32px 0 0 #fff,
    32px 32px 0 0 #eee,
    48px 32px 0 0 #eee;
  filter: opacity(0.8);
  animation: floatCloud 40s linear infinite;
}

/* Multiple cloud instances with different positions and timings */
.cloud:nth-child(1) { top: 15%; animation-delay: 0s; }
.cloud:nth-child(2) { top: 35%; animation-delay: -15s; left: 25%; }
.cloud:nth-child(3) { top: 25%; animation-delay: -30s; left: 50%; }
.cloud:nth-child(4) { top: 45%; animation-delay: -45s; left: 75%; }

body.night-mode {
  background-color: #222;
  color: #ddd;
}

/* Hide all screens by default */
.screen {
  display: none;
}

/* Show only active screen */
.screen.active {
  display: block;
  width: 90%;
  max-width: 480px;
}

#game-screen.active {
  max-width: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#game-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Headings */
h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.2rem; margin-bottom: 2rem; }

/* Home screen buttons */
#home-screen button {
  display: block;
  width: 200px;
  margin: 1rem auto;
  padding: 0.8rem;
  font-size: 1rem;
  cursor: pointer;
  background-color: #fff;
  border: 2px solid #111;
  border-radius: 8px;
  font-family: var(--typewriter-font);
  color: #111; /* Explicit text color */
  -webkit-appearance: none; /* Remove iOS default styling */
}

#home-screen button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

#home-screen button:not(:disabled):hover { background-color: #ccc; }

/* Mobile responsiveness */
@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  #home-screen button { width: 150px; }
}

/* Game header - full screen width */
#game-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  background-color: #f5f5f5;
  border-bottom: 2px solid #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
  height: 2.5rem;
  z-index: 1000;
  transition: background-color 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
              border-bottom-color 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

body.night-mode #game-header {
  border-bottom-color: #666;
  background-color: #333;
}

/* Game clock */
#game-clock {
  font-size: 1rem;
  font-weight: bold;
  font-family: var(--typewriter-font);
  color: #666;
}

body.night-mode #game-clock {
  color: #999;
}

/* Game content section */
#game-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 3.5rem 1rem 0;
  transform-style: preserve-3d;
}

/* Game content inner container */
#game-content > * {
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#board-container {
  max-width: 800px !important;
}

/* Game title container */
#game-title-container {
  text-align: center;
  margin-bottom: 1rem;
  width: 100%;
}

#game-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0;
  line-height: 1.2;
  margin-bottom: 0.1rem;
}

#game-subtitle {
  font-size: 1rem;
  color: #333;
  margin: 0 0 1.5rem 0; /* Added 1.5rem bottom margin */
  line-height: 1.2;
}

body.night-mode #game-subtitle {
  color: #999;
}

/* Back and Help buttons on sides */
.header-btn {
  background-color: #fff;
  border: 2px solid #111;
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  min-width: 2.5rem;
  transition: background-color 0.3s ease;
  font-family: var(--typewriter-font);
  color: #111; /* Explicit text color */
  -webkit-appearance: none; /* Remove iOS default styling */
}

.header-btn:not(:disabled):hover {
  background-color: #e0e0e0;
}

body.night-mode .header-btn {
  background-color: #444;
  border-color: #666;
  color: #ddd;
}

body.night-mode .header-btn:hover {
  background-color: #555;
}

/* Board container */
#board-container {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  flex: 1;
  padding: 0;
}

/* Border elements */
#left-border,
#right-border {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  justify-content: flex-start;
  position: absolute;
  top: 0;
  width: 350px;
  z-index: 100;
  height: 100%;
  box-sizing: border-box;
}

#left-border {
  left: -170px;
}

#right-border {
  right: -170px;
}

/* Responsive layout for smaller screens */
@media (max-width: 1000px) {
  #left-border,
  #right-border {
    position: relative;
    left: auto;
    right: auto;
    width: 100%;
    max-width: 500px;
    height: auto;
    margin-top: 20px;
    order: 3; /* Move below game buttons */
  }

  #board-container {
    flex-direction: column;
    align-items: center;
  }
}

/* Adjust vertical positioning to align with board rows */
.board-row:first-child {
  margin-top: 0;
}

.board-row {
  margin: 4px 0;
}

/* Remove default margin from first and last cells in rows to ensure proper alignment */
.board-row:first-child {
  margin-top: 0;
}

.board-row:last-child {
  margin-bottom: 0;
}

#left-border .border-cell,
#right-border .border-cell {
  width: 350px;
  height: min(8.4vw, 42px);
  min-width: 360px;
  min-height: 21px;
  margin: 4px 0;
  box-sizing: border-box;
  font-size: 1rem;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  text-align: left;
  overflow: hidden;
  white-space: normal;
  word-wrap: break-word;
  transition: all 0.3s ease;
}

#right-border .border-cell {
  text-align: right;
  justify-content: flex-end;
}

body.night-mode #left-border .border-cell,
body.night-mode #right-border .border-cell {
  color: #ddd;
}

/* Dimming effects for opposite definitions */
.dimmed-day {
  opacity: 0.4;
  color: #888 !important;
}

.dimmed-night {
  opacity: 0.4;
  color: #999 !important;
}

.border-cell:hover {
  z-index: 1;
}

.border-cell.focused {
  font-weight: 900;
}

/* Board wrapper */
#board-wrapper {
  perspective: 800px;
  transform-style: preserve-3d;
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  flex: 1;
}

/* Flippable board */
#board {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 300px;
  width: 100%;
  will-change: transform; /* Optimize for smoother animation */
}

/* Board sides */
.board-side {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 300px;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.board-side.day {
  background: transparent;
}

.board-side.night {
  transform: rotateY(-180deg);
  background: transparent;
}

/* Cell backgrounds for day/night */
.board-side.day .cell {
  background: #f5f5f5;
}

.board-side.night .cell {
  background: #2a2a2a;
}

.board-side.night .cell-input:focus {
  background: #444;
}

.board-side.night .cell.disabled {
  background: #1a1a1a;
}

.board-side.day .cell.disabled {
  background: #e6e6e6;
}

.night-mode .cell {
  border-color: #666;
}

.night-mode .cell-input {
  color: #ddd;
}

.night-mode .cell-input:focus {
  background: #444;
}

.night-mode .cell.disabled {
  background: #222;
  color: #666;
  border: none;
}

/* Rows */
.board-row {
  display: flex;
  justify-content: center;
  margin: 4px 0;
  flex-wrap: nowrap;
  height: min(8.4vw, 42px);
  min-height: 21px;
  box-sizing: border-box;
}

/* Night side rows are right-aligned */
.board-side.night .board-row {
  justify-content: flex-end;
}

/* Day side rows remain centered */
.board-side.day .board-row {
  justify-content: flex-start;
}

/* Cells */
.cell {
  width: min(8.4vw, 42px);
  height: min(8.4vw, 42px);
  min-width: 21px;
  min-height: 21px;
  border: 2px solid #111; /* Updated line width */
  border-radius: 6px; /* Added rounded corners */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  font-size: clamp(14px, 2.2vw, 20px);
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

/* Adjust cell margins to ensure proper alignment with border cells */
.cell:first-child {
  margin-left: 2px;
}

.cell:last-child {
  margin-right: 2px;
}

.cell.disabled, .cell.completed, .cell.locked {
  cursor: not-allowed;
}

.cell-input {
  width: 100%;
  height: 100%;
  border: none;
  background: none;
  text-align: center;
  font-family: var(--typewriter-font);
  font-size: inherit;
  padding: 0;
  text-transform: uppercase;
  outline: none;
  caret-color: transparent;
}

.cell:has(.cell-input:focus) {
  border: 4px solid #666;
  box-shadow: 0 0 0 3px rgba(102, 102, 102, 0.25);
  z-index: 10;
}

.cell.disabled, .cell.locked {
  color: #999;
  cursor: not-allowed;
  border: none;
}

.cell.disabled .cell-input {
  pointer-events: none;
}

/* Day side completed words get night background */
.board-side.day .cell.completed {
  background: #333 !important;
  color: #ddd;
  transform: scale(1.05);
  transition: all 0.3s ease-in-out;
}

/* Night side completed words get day background */
.board-side.night .cell.completed {
  background: #f5f5f5 !important;
  color: #111;
  transform: scale(1.05);
  transition: all 0.3s ease-in-out;
}

/* Ensure inputs in completed cells match text color */
.board-side.day .cell.completed .cell-input {
  color: #ddd;
  transition: color 0.3s ease-in-out;
}

.board-side.night .cell.completed .cell-input {
  color: #111;
  transition: color 0.3s ease-in-out;
}

/* Return to normal scale after animation */
.board-side.day .cell.completed,
.board-side.night .cell.completed {
  transform: scale(1);
}

.cell.locked {
  pointer-events: none;
}

/* Twilight letters in completed words */
.cell.completed.twilight .cell-input {
  font-weight: bold;
}

/* Completion animation */
@keyframes completionAccent {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.cell.completion-animate {
  animation: completionAccent 0.3s ease-in-out;
}

/* Highlight twilight letters */
@keyframes twilightPulse {
  0% {
    background-color: #888;
  }
  50% {
    background-color: #666;
  }
  100% {
    background-color: #888;
  }
}

.cell.completed.twilight.active .cell-input {
  background-color: #888 !important;
  animation: twilightPulse 2s ease-in-out infinite;
  color: #fff !important;
}

/* Ensure twilight letters are visible in both modes */
.board-side.day .cell.completed.twilight.active .cell-input,
.board-side.night .cell.completed.twilight.active .cell-input {
  color: #fff !important;
}

/* Buttons below the board */
#game-buttons {
  display: flex;
  justify-content: center;
  gap: clamp(5px, 1vw, 10px);
  padding: 1rem;
  margin-top: 1rem; /* Reduced from 2rem */
  background: transparent;
  width: 100%;
  margin-bottom: 2rem; /* Reduced from 4.75rem */
}

#game-buttons button {
  background-color: #fff;
  border: 2px solid #111;
  border-radius: 6px;
  padding: clamp(0.3rem, 1vw, 0.4rem) clamp(0.6rem, 2vw, 0.8rem);
  font-size: clamp(14px, 2vw, 16px);
  cursor: pointer;
  flex: 0 1 auto;
  min-width: max-content;
  font-family: var(--typewriter-font);
  transition: all 0.3s ease;
  color: #111; /* Explicit text color */
  -webkit-appearance: none; /* Remove iOS default styling */
}

#game-buttons button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

#game-buttons button:not(:disabled):hover {
  background-color: #ccc;
}

body.night-mode #game-buttons button {
  background-color: #444;
  border-color: #666;
  color: #ddd;
}

body.night-mode #game-buttons button:hover {
  background-color: #555;
}

/* Game footer */
#game-footer {
  display: none;
}

#word-definition {
  font-size: 1rem;
  color: #111;
  font-family: var(--typewriter-font);
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  font-weight: normal;
  transition: font-weight 0.2s ease;
}

#word-definition.focused {
  font-weight: 900;
}

body.night-mode #word-definition {
  color: #ddd;
}

/* Modal styling */
.modal-container {
  display: none;
  position: fixed;
  top: 2.5rem;
  left: 0;
  width: 100%;
  height: calc(100% - 5rem);
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-container.active ~ * {
  pointer-events: none;
}

.modal-container.active .modal {
  pointer-events: auto;
}

.modal-container.active {
  display: flex;
}

.modal {
  background-color: #f5f5f5;
  border: 2px solid #111;
  border-radius: 8px;
  max-width: 90%;
  width: 500px;
  position: relative;
  animation: modalAppear 0.3s ease-out;
  max-height: calc(100vh - 6rem);
  display: flex;
  flex-direction: column;
}

body.night-mode .modal {
  background-color: #333;
  border-color: #666;
}

.modal-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
  padding: 2rem 2rem 0;
  flex: 1;
  /* Scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: #666 transparent;
}

.modal-content::-webkit-scrollbar {
  width: 8px;
}

.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
  background-color: #666;
  border-radius: 4px;
  border: 2px solid transparent;
}

body.night-mode .modal-content::-webkit-scrollbar-thumb {
  background-color: #999;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: bold;
  font-family: var(--typewriter-font);
  color: #111;
  margin: 0 0 0.1rem 0;
  line-height: 1.2;
}

.modal-title + .modal-twilight-word {
  margin-top: -0.2rem;
}

.modal-twilight-word {
  font-size: 0.9rem;
  font-family: var(--typewriter-font);
  color: #666;
  margin: 0;
  line-height: 1.2;
}

body.night-mode .modal-twilight-word {
  color: #999;
}

body.night-mode .modal-title {
  color: #ddd;
}

.modal-image {
  width: 100%;
  max-width: 500px;
  border-radius: 4px;
  margin: 0 auto;
  display: block;
  cursor: pointer;
}

.game-complete-image {
  filter: grayscale(100%);
  height: calc((100vh - 6rem) / 3);
  object-fit: contain;
}

.modal-quote {
  font-size: 1.1rem;
  line-height: 1.3;
  font-style: italic;
  font-family: var(--typewriter-font);
  color: #333;
  margin: 0.5rem 0;
  padding: 0;
  text-align: left;
}

body.night-mode .modal-quote {
  color: #ccc;
}

.modal-author {
  font-size: 1.1rem;
  color: #666;
  font-family: var(--typewriter-font);
  margin: 0;
  line-height: 1.1;
  text-align: right;
}

body.night-mode .modal-author {
  color: #999;
}

.modal-description {
  font-size: 1.1rem;
  line-height: 1.3;
  font-family: var(--typewriter-font);
  color: #444;
  text-align: left;
  margin: 0.5rem 0;
}

.modal-description h3,
.modal-description ul,
.modal-description p {
  text-align: left !important;
  margin-left: 0;
  padding-left: 0;
}

.modal-description ul {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.modal-description li {
  margin: 0.25rem 0;
}

body.night-mode .modal-description {
  color: #bbb;
}

.modal-score {
  font-size: 1.1rem;
  font-family: var(--typewriter-font);
  color: #111;
  margin-top: 1rem;
}

.modal-score .time,
.modal-score .actions {
  font-weight: bold;
}

body.night-mode .modal-score {
  color: #ddd;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background-color: inherit;
  border-top: 1px solid #ddd;
  margin-top: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

body.night-mode .modal-buttons {
  border-top-color: #444;
}

.modal-buttons button {
  background-color: #fff;
  border: 2px solid #111;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  font-family: var(--typewriter-font);
  min-width: 100px;
  color: #111; /* Explicit text color */
  -webkit-appearance: none; /* Remove iOS default styling */
}

.modal-buttons button:disabled {
  cursor: not-allowed;
}

.modal-buttons button:not(:disabled):hover {
  background-color: #e0e0e0;
}

body.night-mode .modal-buttons button {
  background-color: #444;
  border-color: #666;
  color: #ddd;
}

body.night-mode .modal-buttons button:hover {
  background-color: #555;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scoreboard screen styling */
#scoreboard-screen .buttons {
  margin-top: 10px;
}

/* Scoreboard table styling */
.scoreboard-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-family: var(--typewriter-font);
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
}

body.night-mode .scoreboard-table {
  background-color: #444;
}

.scoreboard-table th,
.scoreboard-table td {
  padding: 0.8rem;
  text-align: center;
  border: 1px solid #ddd;
}

body.night-mode .scoreboard-table th,
body.night-mode .scoreboard-table td {
  border-color: #666;
}

.scoreboard-table th {
  background-color: #f5f5f5;
  font-weight: bold;
  color: #111;
}

body.night-mode .scoreboard-table th {
  background-color: #333;
  color: #ddd;
}

.scoreboard-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

body.night-mode .scoreboard-table tr:nth-child(even) {
  background-color: #3a3a3a;
}

.scoreboard-table tr:hover {
  background-color: #f0f0f0;
}

body.night-mode .scoreboard-table tr:hover {
  background-color: #505050;
}

.country-flag {
  width: 20px;
  height: auto;
  vertical-align: middle;
}

/* Adjust modal size for scoreboard */
.modal-content:has(.scoreboard-table) {
  padding: 1.5rem;
  max-height: calc(100vh - 8rem);
  pointer-events: auto;
}

/* Enable pointer events only for scrolling and main menu button */
.modal-content:has(.scoreboard-table) .modal-buttons {
  pointer-events: auto;
}

.modal:has(.scoreboard-table) {
  width: min(90%, 800px);
}

/* Games list styling */
.games-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.game-item button {
  width: 100%;
  padding: 0.6rem;
  font-family: var(--typewriter-font);
  background-color: #fff;
  border: 2px solid #111;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  line-height: 1.2;
  text-align: left;
  color: #111; /* Explicit text color */
  -webkit-appearance: none; /* Remove iOS default styling */
}

.game-date {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.2rem;
}

.game-title {
  font-size: 1rem;
  font-weight: bold;
}

body.night-mode .game-date {
  color: #999;
}

body.night-mode .game-title {
  color: #ddd;
}

.game-item button:not(:disabled):hover {
  background-color: #e0e0e0;
}

body.night-mode .game-item button {
  background-color: #444;
  border-color: #666;
  color: #ddd;
}

body.night-mode .game-item button:hover {
  background-color: #555;
}
