:root {
  --bg-dark: #0E1113;
  --bg-card: #1A1A1B;
  --border-color: #343536;
  --reddit-orange: #FF4500;
  --text-main: #D7DADC;
  --text-muted: #818384;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.app-container {
  width: 100%;
  max-width: 480px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.brand h1 span {
  color: var(--reddit-orange);
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
}

.info-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background-color: #272729;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.info-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 700;
}

.info-val {
  font-size: 0.95rem;
  font-weight: 600;
}

.board-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0;
}

.grid-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 6px;
  width: 320px;
  height: 320px;
  background-color: #121212;
  border-radius: 8px;
  padding: 6px;
  border: 2px solid var(--border-color);
}

.grid-cell {
  background-color: #272729;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, background-color 0.2s ease;
}

.grid-cell:hover {
  transform: scale(1.04);
}

.endpoint {
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.controls-bar {
  display: flex;
  gap: 8px;
}

.btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 9999px;
  border: none;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.primary-btn {
  background-color: var(--reddit-orange);
  color: #FFFFFF;
}

.secondary-btn {
  background-color: #343536;
  color: var(--text-main);
}

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

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-preview {
  background-color: #121212;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  font-size: 0.75rem;
  overflow-x: auto;
}

.modal-actions {
  display: flex;
  gap: 8px;
}
