/* ============================================
   ECH Myanmar — C1 Word Challenge Game Styles
   ============================================ */

/* ── Page Layout ── */
.game-main {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 4rem;
  position: relative;
}

/* ── Hero Background ── */
.game-hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 260px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.game-hero-bg {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 0%,   rgba(0,113,227,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 0%,   rgba(52,170,220,0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(175,82,222,0.06) 0%, transparent 55%);
}

/* ── Game Wrapper ── */
.game-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  padding-top: 2.5rem;
}

/* ── Game Card (shared by game + result) ── */
.game-card {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 28px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10), 0 1px 0 rgba(255,255,255,0.8) inset;
  padding: 2rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── Card Header ── */
.game-card-header {
  text-align: center;
}

.game-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #0071e3, #34aadc);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 0.75rem;
}

.game-title {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary, #1d1d1f);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.game-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted, #86868b);
  line-height: 1.6;
  max-width: 360px;
  margin: 0 auto;
}

/* ── Status Bar ── */
.game-status-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 14px;
  overflow: hidden;
}

.status-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.65rem 0.5rem;
  gap: 0.15rem;
}

.status-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #86868b);
}

.status-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary, #1d1d1f);
  letter-spacing: -0.02em;
}

.status-value--blue { color: var(--blue, #0071e3); }

.status-divider {
  width: 1px;
  height: 36px;
  background: rgba(0,0,0,0.08);
  flex-shrink: 0;
}

/* ── Hint Box ── */
.hint-box {
  background: linear-gradient(135deg, rgba(0,113,227,0.07), rgba(52,170,220,0.05));
  border: 1px solid rgba(0,113,227,0.18);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary, #3a3a3c);
  line-height: 1.6;
  text-align: center;
}

/* ── Grid ── */
.grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: grid;
  gap: 8px;
}

.cell {
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: uppercase;
  background: white;
  color: var(--text-primary, #1d1d1f);
  letter-spacing: 0.02em;
  transition: border-color 0.15s ease;
  font-family: var(--font, 'Inter', sans-serif);
}

.cell.correct {
  background: #34c759;
  border-color: #34c759;
  color: white;
  box-shadow: 0 4px 12px rgba(52,199,89,0.35);
}

.cell.present {
  background: #ff9f0a;
  border-color: #ff9f0a;
  color: white;
  box-shadow: 0 4px 12px rgba(255,159,10,0.35);
}

.cell.wrong {
  background: rgba(0,0,0,0.15);
  border-color: transparent;
  color: white;
}

/* Flip-in animation on guess reveal */
@keyframes cellFlip {
  0%   { transform: scaleY(1); }
  45%  { transform: scaleY(0); }
  55%  { transform: scaleY(0); }
  100% { transform: scaleY(1); }
}

.cell--flip {
  animation: cellFlip 0.4s ease forwards;
}

/* ── Colour Legend ── */
.legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #86868b);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-dot--correct { background: #34c759; }
.legend-dot--present { background: #ff9f0a; }
.legend-dot--wrong   { background: rgba(0,0,0,0.18); }

/* ── Input Controls ── */
.controls {
  display: flex;
  gap: 0.6rem;
}

.controls input {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 2px solid rgba(0,0,0,0.12);
  font-size: 1rem;
  font-family: var(--font, 'Inter', sans-serif);
  font-weight: 600;
  color: var(--text-primary, #1d1d1f);
  background: white;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.controls input:focus {
  border-color: var(--blue, #0071e3);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
}

.controls input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-guess {
  padding: 0.85rem 1.4rem;
  border: none;
  border-radius: 12px;
  background: var(--blue, #0071e3);
  color: white;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font, 'Inter', sans-serif);
  letter-spacing: -0.01em;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 14px rgba(0,113,227,0.3);
  white-space: nowrap;
}

.btn-guess:hover {
  background: #0062c4;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,113,227,0.35);
}

.btn-guess:active {
  transform: scale(0.97);
  box-shadow: none;
}

.btn-guess:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Message ── */
.message {
  min-height: 28px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  border-radius: 10px;
  padding: 0.4rem 0.75rem;
  transition: all 0.2s ease;
}

.message--success {
  background: rgba(52,199,89,0.12);
  border: 1px solid rgba(52,199,89,0.3);
  color: #1a8c3a;
}

.message--error {
  background: rgba(255,59,48,0.08);
  border: 1px solid rgba(255,59,48,0.2);
  color: #c0392b;
}

.message--reveal {
  background: rgba(255,159,10,0.1);
  border: 1px solid rgba(255,159,10,0.3);
  color: #b86e00;
}

/* ── Result Screen ── */
.result-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.result-logo img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

.result-heading {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary, #1d1d1f);
}

/* Score ring */
.result-score-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 5px solid rgba(0,0,0,0.08);
  box-shadow: 0 8px 28px rgba(0,0,0,0.10);
  background: white;
  transition: border-color 0.4s ease;
}

.ring--gold { border-color: #ff9f0a; box-shadow: 0 8px 28px rgba(255,159,10,0.3); }
.ring--blue { border-color: #0071e3; box-shadow: 0 8px 28px rgba(0,113,227,0.3); }
.ring--grey { border-color: rgba(0,0,0,0.15); }

.result-score-number {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary, #1d1d1f);
  line-height: 1;
}

.result-score-denom {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #86868b);
}

.result-message {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary, #1d1d1f);
  letter-spacing: -0.02em;
}

/* Word breakdown table */
.result-breakdown {
  width: 100%;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
}

.breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 0.85rem;
}

.breakdown-row:last-child { border-bottom: none; }

.breakdown-word {
  font-weight: 700;
  letter-spacing: 0.06em;
}

.breakdown-word--solved { color: #1a8c3a; }
.breakdown-word--missed { color: #c0392b; text-decoration: line-through; opacity: 0.7; }

.breakdown-pts {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted, #86868b);
}

.btn-restart {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #0071e3, #34aadc);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font, 'Inter', sans-serif);
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: opacity 0.2s ease, transform 0.15s ease;
  box-shadow: 0 6px 20px rgba(0,113,227,0.3);
}

.btn-restart:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-restart:active { transform: scale(0.98); }

.btn-articles {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1.5px solid rgba(0,0,0,0.12);
  background: white;
  color: var(--text-secondary, #3a3a3c);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font, 'Inter', sans-serif);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-articles:hover {
  background: rgba(0,113,227,0.05);
  border-color: rgba(0,113,227,0.25);
  color: var(--blue, #0071e3);
}

.btn-screenshot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.8rem;
  border-radius: 14px;
  border: 1.5px solid rgba(0,0,0,0.12);
  background: white;
  color: var(--text-secondary, #3a3a3c);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font, 'Inter', sans-serif);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-screenshot:hover {
  background: rgba(52,199,89,0.07);
  border-color: rgba(52,199,89,0.35);
  color: #1a8c3a;
}

.btn-screenshot:active {
  transform: scale(0.98);
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */

/* Tablet portrait (≤ 768px) */
@media (max-width: 768px) {
  .game-wrapper { padding-top: 1.75rem; }
  .game-card    { padding: 1.5rem 1.5rem 1.25rem; gap: 1rem; }
  .cell         { font-size: 1rem; border-radius: 8px; }
}

/* Phone (≤ 480px) */
@media (max-width: 480px) {
  .game-wrapper { padding-top: 1.25rem; }
  .game-card    { padding: 1.25rem 1rem 1rem; border-radius: 20px; }
  .game-title   { font-size: 1.5rem; }

  .status-label { font-size: 0.58rem; }
  .status-value { font-size: 0.82rem; }

  .cell         { font-size: 0.9rem; border-radius: 7px; }

  .controls input,
  .btn-guess    { font-size: 0.9rem; padding: 0.75rem 0.85rem; }

  .legend       { gap: 0.65rem; }
  .legend-item  { font-size: 0.67rem; }
}

/* Very small (≤ 360px) */
@media (max-width: 360px) {
  .cell         { font-size: 0.8rem; border-radius: 6px; }
  .btn-guess    { padding: 0.75rem 0.7rem; }
  .legend       { display: none; }
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  line-height: 1;
}

.footer-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}