/* ============ GAME SUSUN ANGKA STYLES ============ */
:root {
  --primary: #ff6b6b;
  --secondary: #4ecdc4;
  --accent: #ffd166;
  --peach: #ff9a8b;
  --mint: #95e1d3;
  --light-bg: #f9f7f7;
  --text-dark: #2c3e50;
  --text-light: #ffffff;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--light-bg);
  color: var(--text-dark);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path fill="%23FFD166" opacity="0.15" d="M50,10 C65,10 77,22 77,37 C77,52 65,64 50,64 C35,64 23,52 23,37 C23,22 35,10 50,10 Z"/><path fill="%234ECDC4" opacity="0.15" d="M50,70 C65,70 77,82 77,97 C77,112 65,124 50,124 C35,124 23,112 23,97 C23,82 35,70 50,70 Z"/>');
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  width: 100%;
}

header {
  text-align: center;
  padding: 25px 0;
  background: linear-gradient(135deg, var(--primary), var(--peach));
  color: var(--text-light);
  border-radius: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: var(--accent);
}

.header-content {
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.95;
}

.arabic-decoration {
  font-family: "Traditional Arabic", "Scheherazade", serif;
  font-size: 2rem;
  color: var(--accent);
  margin: 15px 0;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.islamic-pattern {
  height: 50px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><path fill="%23FF6B6B" opacity="0.2" d="M30,10 C40,10 47,17 47,27 C47,37 40,44 30,44 C20,44 13,37 13,27 C13,17 20,10 30,10 Z"/><path fill="%234ECDC4" opacity="0.2" d="M30,50 C40,50 47,57 47,67 C47,77 40,84 30,84 C20,84 13,77 13,67 C13,57 20,50 30,50 Z"/>');
  margin: 25px 0;
  opacity: 0.7;
}

.game-main-content {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
  border: 2px solid var(--accent);
  margin-bottom: 30px;
}

.back-button-container {
  margin-bottom: 25px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 3px 8px rgba(255, 107, 107, 0.2);
  border: 2px solid var(--peach);
}

.back-btn:hover {
  background: var(--peach);
  transform: translateX(-5px);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

.back-btn:active {
  transform: translateX(-2px);
}

.back-btn i {
  font-size: 1.1rem;
}

.section-title {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title i {
  color: var(--accent);
}

.game-instructions {
  background: linear-gradient(135deg, #fff9f9, #fff0f0);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 25px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  border-left: 5px solid var(--accent);
}

.game-instructions p {
  margin: 10px 0;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 500;
}

.game-instructions i {
  color: var(--accent);
  font-size: 1.2rem;
  min-width: 24px;
}

/* Game Area */
.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  margin: 30px 0;
}

.game-info {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 700px;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary), var(--peach));
  color: white;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.2);
}

.game-info-item {
  text-align: center;
  flex: 1;
}

.game-info-value {
  font-size: 2rem;
  font-weight: bold;
  margin-top: 5px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Game Boards */
.game-boards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  width: 100%;
}

.board {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.board-title {
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: bold;
  text-align: center;
}

/* PERUBAHAN UTAMA: Ukuran number board untuk 5 angka */
.number-board {
  display: flex;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(135deg, #fff9f9, #fff0f0);
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  border: 3px solid var(--accent);
  min-height: 120px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.board-target {
  border-color: var(--secondary);
}

.board-source {
  border-color: var(--accent);
}

/* PERUBAHAN UTAMA: Ukuran number slot lebih kecil untuk 5 kolom */
.number-slot {
  width: 65px;
  height: 65px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, var(--secondary), #6ce5de);
  box-shadow: 0 4px 8px rgba(78, 205, 196, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.number-slot.source {
  background: linear-gradient(135deg, var(--accent), #ffe082);
  cursor: grab;
}

.number-slot.source:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 6px 12px rgba(255, 209, 102, 0.3);
}

.number-slot.target {
  background: linear-gradient(135deg, #2196f3, #42a5f5);
  min-height: 65px;
}

.number-slot.empty {
  background: #e0e0e0;
  color: transparent;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
  cursor: default;
}

.number-slot.correct {
  background: linear-gradient(135deg, var(--secondary), #6ce5de);
  animation: correct-pulse 0.5s ease;
}

@keyframes correct-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.number-slot.wrong {
  background: linear-gradient(135deg, #f44336, #ef5350);
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Animasi pulse untuk hint */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--accent);
  }
}

/* Game Controls */
.game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
  width: 100%;
}

.btn {
  padding: 16px 30px;
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(255, 107, 107, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  min-width: 180px;
}

.btn:hover {
  background: var(--peach);
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(255, 107, 107, 0.3);
}

.btn:active {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ffe082);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ffb74d, #ffd166);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), #6ce5de);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #3dbdb4, var(--secondary));
}

/* Feedback */
.feedback {
  display: none;
  text-align: center;
  padding: 20px;
  border-radius: 15px;
  margin: 20px auto;
  font-size: 1.3rem;
  font-weight: 600;
  animation: fadeIn 0.5s ease;
  width: 100%;
  max-width: 700px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback.correct {
  color: var(--secondary);
  background: #e8f5e9;
  border: 2px solid var(--secondary);
}

.feedback.incorrect {
  color: #f44336;
  background: #ffebee;
  border: 2px solid #f44336;
}

.feedback[style*="display: block"] {
  display: block;
}

/* Game Tips */
.game-tips {
  background: rgba(255, 209, 102, 0.15);
  padding: 25px;
  border-radius: 18px;
  margin-top: 30px;
  border: 2px dashed var(--accent);
}

.game-tips p {
  margin: 8px 0;
  color: var(--primary);
  font-size: 1rem;
  line-height: 1.5;
}

.game-tips p:first-child {
  margin-bottom: 15px;
}

.game-tips strong {
  color: var(--accent);
  font-size: 1.1rem;
}

.game-tips i {
  color: var(--accent);
  margin-right: 10px;
  min-width: 20px;
}

footer {
  text-align: center;
  padding: 20px;
  background: var(--primary);
  color: white;
  border-radius: 15px;
  margin-top: 30px;
  box-shadow: var(--shadow);
}

footer p {
  margin: 5px 0;
}

footer i {
  color: var(--accent);
}

/* ============ RESPONSIVE DESIGN UNTUK 5 KOLOM ============ */

/* Desktop Besar (min-width: 1200px) */
@media (min-width: 1200px) {
  .container {
    max-width: 1100px;
  }

  .number-slot {
    width: 70px;
    height: 70px;
    font-size: 2.5rem;
  }
}

/* Tablet Landscape (1024px - 1199px) */
@media (max-width: 1199px) and (min-width: 1024px) {
  .number-slot {
    width: 65px;
    height: 65px;
    font-size: 2.3rem;
  }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
  .container {
    padding: 15px;
    max-width: 95%;
  }

  .game-main-content {
    padding: 25px;
  }

  .game-boards {
    gap: 30px;
  }

  .number-board {
    gap: 10px;
    padding: 15px;
  }

  .number-slot {
    width: 55px;
    height: 55px;
    font-size: 1.9rem;
  }

  .game-info-value {
    font-size: 1.8rem;
  }

  .btn {
    min-width: 160px;
    padding: 14px 25px;
  }
}

/* Tablet Portrait (576px - 767px) */
@media (max-width: 767px) {
  header {
    padding: 20px 15px;
  }

  header h1 {
    font-size: 2.2rem;
  }

  header p {
    font-size: 1.1rem;
  }

  .arabic-decoration {
    font-size: 1.8rem;
  }

  .game-main-content {
    padding: 20px;
  }

  .back-btn {
    padding: 12px 20px;
    font-size: 1rem;
    width: 100%;
    justify-content: center;
  }

  .section-title {
    font-size: 1.4rem;
  }

  .game-instructions p {
    font-size: 1rem;
    gap: 10px;
  }

  .game-boards {
    flex-direction: column;
    gap: 25px;
  }

  .number-board {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 15px;
  }

  .number-slot {
    width: 50px;
    height: 50px;
    font-size: 1.7rem;
  }

  .game-controls {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 300px;
  }

  .feedback {
    font-size: 1.2rem;
    padding: 15px;
  }

  .game-tips {
    padding: 20px;
  }
}

/* Mobile Kecil (max-width: 576px) */
@media (max-width: 576px) {
  .container {
    padding: 10px;
    max-width: 100%;
  }

  header {
    padding: 15px 10px;
    border-radius: 15px;
  }

  header h1 {
    font-size: 1.8rem;
  }

  .arabic-decoration {
    font-size: 1.6rem;
  }

  .game-info {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .number-slot {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
  }

  .board-title {
    font-size: 1.1rem;
  }
}

/* Mobile Sangat Kecil (max-width: 380px) */
@media (max-width: 380px) {
  .number-slot {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    border-radius: 10px;
  }

  .number-board {
    gap: 6px;
    padding: 10px;
  }
}

/* Fix untuk touch targets */
@media (max-width: 576px) {
  .number-slot,
  .btn,
  .back-btn {
    min-height: 44px;
  }
}
