/* Base Variables & Reset */
:root {
  --bg-color: #121212;
  --text-main: #ffffff;
  --text-muted: #a0a0a0;
  --accent: #4a90e2;
  --accent-hover: #357abd;
  --card-bg: #1e1e1e;
  --card-border: #333333;
  --success: #4cd964;
  --error: #ff3b30;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

/* Header / Hub specific */
.hub-header {
  text-align: center;
  margin-bottom: 40px;
  margin-top: 20px;
}

.hub-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #fff, #a0a0a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Language Switcher */
.lang-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
}
.lang-btn {
  background: none;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s;
}
.lang-btn.active {
  color: var(--text-main);
  border-color: var(--text-main);
  background: var(--card-bg);
}

/* Grid Layout */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 800px;
}

@media (max-width: 600px) {
  .games-grid {
    grid-template-columns: 1fr;
  }
}

/* Game Card */
.game-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.game-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.game-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.game-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Completed State */
.game-card.completed {
  opacity: 0.6;
  border-color: var(--success);
}
.completed-badge {
  display: none;
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--success);
  color: #000;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}
.game-card.completed .completed-badge {
  display: flex;
}

/* Shared Game Header */
.game-header {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  margin-top: 10px;
}
.back-btn {
  text-decoration: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.2s;
}
.back-btn:hover {
  color: var(--text-main);
}
.game-page-title {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
}
.modal-title {
  font-size: 1.8rem;
  margin-bottom: 15px;
  font-weight: 800;
}
.modal-stats {
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 25px;
}

/* Buttons */
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  margin-bottom: 10px;
  font-family: inherit;
}
.btn:hover {
  background: var(--accent-hover);
}
.btn:disabled {
  background: var(--card-border);
  color: var(--text-muted);
  cursor: not-allowed;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-secondary:hover {
  background: rgba(74, 144, 226, 0.1);
}

/* Base Game Area */
.game-area {
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.input-field {
  width: 100%;
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 15px;
}
.input-field:focus {
  outline: none;
  border-color: var(--accent);
}
