:root {
  --bg-color: #f4f6f8;
  --panel-bg: #ffffff;
  --text-color: #1f2937;
  --primary-color: #2563eb;
  --border-color: #e5e7eb;

  /* Tile Colors */
  --tile-unguessed: #e5e7eb; /* Light Grey */
  --tile-guessed: #fef08a;   /* Pale Yellow */
  --tile-circled: #bbf7d0;   /* Pale Green */
  --tile-crossed: #fecdd3;   /* Pale Maroon */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
}

#app {
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--panel-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
}

.view-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  position: relative;
}

/* Bottom Navigation */
.bottom-nav {
  height: 60px;
  border-top: 1px solid var(--border-color);
  display: flex;
  background: #ffffff;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
  font-size: 11px;
}

.nav-item.active {
  color: var(--primary-color);
  font-weight: 600;
}

.nav-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 2px;
}

/* 3D Tile Styling */
.tile {
  width: 32px;
  height: 38px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  margin: 2px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: transform 0.05s ease;
}

.tile:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.tile.unguessed { background-color: var(--tile-unguessed); color: #374151; }
.tile.guessed { background-color: var(--tile-guessed); color: #854d0e; }
.tile.circled { background-color: var(--tile-circled); color: #166534; border: 2px solid #22c55e; }
.tile.crossed { background-color: var(--tile-crossed); color: #991b1b; text-decoration: line-through; }

/* Floating Action Button (FAB) */
.fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  z-index: 50;
}

.fab.secondary {
  bottom: 80px;
  background: #4b5563;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Game Mode Table Layout */
.game-table-container {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 12px 0;
}

.game-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
}

.game-table th {
  height: 36px;
  width: 50%;
  padding: 8px;
  border-bottom: 2px solid var(--border-color);
  background: #f9fafb;
  font-size: 13px;
}

.game-table td {
  width: 50%;
  padding: 6px;
  vertical-align: top;
  border-right: 1px solid var(--border-color);
}

.game-table td:last-child {
  border-right: none;
}

.guess-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.match-count {
  font-size: 18px;
  font-weight: 800;
  margin: 0 6px;
  min-width: 20px;
  text-align: center;
}

/* Custom QWERTY Keyboard */
.keyboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  background: #f3f4f6;
  border-radius: 8px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.key-tile {
  flex: 1;
  max-width: 36px;
  height: 42px;
  padding: 0;
}

.key-backspace {
  width: 56px;
  height: 130px;
  background: #9ca3af;
  color: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}

/* Popover Marking Menu */
.popover-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popover-menu {
  background: white;
  padding: 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 220px;
}

.popover-btn {
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}