/*!
  Shogi Game Specific Styles
  Only loaded on homepage
*/

/* ================================================
   SHOGI GAME LAYOUT
   ================================================ */

.game-container {
  padding: 10px;
  margin: 10px auto;
  max-width: 1200px;
}

.game-content {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.shogi-board {
  flex: 2;
  background: #F5DEB3 ;
  border-radius: 6px;
  padding: 16px;
  border: 1px solid rgba(200, 200, 200, 0.3);
  width: 100%;
  min-height: 320px;
}


.game-controls {
  flex: 1;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(200, 200, 200, 0.3);
  min-width: 280px;
  width: 100%;
}

/* ================================================
   GAME CONTROLS
   ================================================ */

.control-section {
  margin-bottom: 16px;
  /* padding-bottom: 12px; */
}

.control-section:not(:last-child) {
  border-bottom: 1px solid rgba(233, 236, 239, 0.5);
}

.control-section:last-child {
  margin-bottom: 0;
}

.control-section h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}

/* Status Display */
.status-display {
  background: rgba(248, 249, 250, 0.9);
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
  text-align: center;
  border: 1px solid rgba(200, 200, 200, 0.3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.status-text {
  font-weight: 700;
  margin-bottom: 8px;
  color: #2c3e50;
  font-size: 1rem;
}

.status-detail {
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.4;
}

/* ================================================
   BUTTONS & CONTROLS
   ================================================ */

/* Base Button Styles */
.game-controls .btn {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  color: #495057;
  border: 1px solid #dee2e6;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 100%;
  margin-bottom: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.game-controls .btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  border-color: #adb5bd;
  color: #212529;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.game-controls .btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.game-controls .btn:disabled {
  background: #f8f9fa;
  color: #6c757d;
  border-color: #e9ecef;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Success Button (New Game) - Larger & More Prominent */
.game-controls .btn.btn-success {
  background: linear-gradient(135deg, #ff0033 0%, #e60029 100%);
  color: #fff;
  border-color: #ff0033;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  padding: 16px 20px;
  font-size: 1rem;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(255, 0, 51, 0.2);
}

.game-controls .btn.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #e60029 0%, #cc0024 100%);
  border-color: #e60029;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 0, 51, 0.4);
}

/* Switch Button (Flip Board) - Larger & More Prominent */
.game-controls .btn.btn-switch {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: #fff;
  border-color: #17a2b8;
  font-weight: 500;
  padding: 16px 20px;
  font-size: 1rem;
  margin-bottom: 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
}

.game-controls .btn.btn-switch:hover:not(:disabled) {
  background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
  border-color: #138496;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(23, 162, 184, 0.4);
}

/* ================================================
   DIFFICULTY SELECTOR - LUÔN 2 CỘT
   ================================================ */

.difficulty-selector {
  display: grid;
  grid-template-columns: 1fr 1fr; /* LUÔN 2 cột */
  gap: 8px;
  margin-top: 10px;
}

.difficulty-btn {
  padding: 10px 8px;
  font-size: 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Difficulty Colors - Chưa chọn chỉ border */
.difficulty-btn[data-difficulty="easy"] {
  background: transparent;
  color: #28a745;
  border: 2px solid #28a745;
}

.difficulty-btn[data-difficulty="easy"].active {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  color: #fff;
  border-color: #28a745;
  box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.difficulty-btn[data-difficulty="normal"] {
  background: transparent;
  color: #ffc107;
  border: 2px solid #ffc107;
}

.difficulty-btn[data-difficulty="normal"].active {
  background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
  color: #212529;
  border-color: #ffc107;
  box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
}

.difficulty-btn[data-difficulty="hard"] {
  background: transparent;
  color: #dc3545;
  border: 2px solid #dc3545;
}

.difficulty-btn[data-difficulty="hard"].active {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #fff;
  border-color: #dc3545;
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.difficulty-btn[data-difficulty="very-hard"] {
  background: transparent;
  color: #17a2b8;
  border: 2px solid #17a2b8;
}

.difficulty-btn[data-difficulty="very-hard"].active {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: #fff;
  border-color: #17a2b8;
  box-shadow: 0 2px 6px rgba(23, 162, 184, 0.3);
}

.difficulty-btn:hover:not(.active) {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ================================================
   GAME BUTTONS LAYOUT - LUÔN 2 CỘT
   ================================================ */

.game-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr; /* LUÔN 2 cột */
  gap: 10px;
  margin-top: 15px;
}

.game-buttons .btn {
  margin-bottom: 0;
  font-size: 0.85rem;
  padding: 10px 8px;
}

/* ================================================
   ERROR/SUCCESS MESSAGES
   ================================================ */

.error-message,
.success-message {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.error-message {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.success-message {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* ================================================
   SEO CONTENT STYLING
   ================================================ */

.seo-content {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 0 20px;
  font-family: inherit;
  line-height: 1.7;
  color: #2c3e50;
}

.main-article {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.article-header {
  text-align: center;
  padding-bottom: 20px;
  margin-bottom: 30px;
  border-bottom: 2px solid #f03;
  position: relative;
}

.article-header h1 {
  margin: 0 0 15px 0;
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1.3;
}

.article-meta {
  font-size: 0.9rem;
  color: #6c757d;
  font-style: italic;
}

/* Section Styling */
.intro-section,
.game-features,
.shogi-guide,
.getting-started,
.faq-section {
  margin-bottom: 35px;
  padding-bottom: 25px;
  border-bottom: 1px solid #e9ecef;
}

.intro-section:last-child,
.game-features:last-child,
.shogi-guide:last-child,
.getting-started:last-child,
.faq-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.seo-content h2 {
  margin: 0 0 20px 0;
  color: #2c3e50;
  font-size: 1.5rem;
  font-weight: 600;
  border-left: 4px solid #f03;
  padding-left: 15px;
  line-height: 1.3;
}

.seo-content h3 {
  margin: 25px 0 15px 0;
  color: #495057;
  font-size: 1.2rem;
  font-weight: 600;
}

.seo-content h4 {
  margin: 20px 0 10px 0;
  color: #495057;
  font-size: 1.1rem;
  font-weight: 600;
}

.seo-content p {
  margin-bottom: 16px;
  line-height: 1.7;
}

/* Highlight Boxes */
.highlight-box {
  background: rgba(248, 249, 250, 0.8);
  border: 1px solid rgba(200, 200, 200, 0.3);
  border-radius: 6px;
  padding: 18px;
  margin: 20px 0;
  border-left: 3px solid #6c757d;
}

.highlight-box h3 {
  color: #495057;
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.highlight-box ul {
  margin: 10px 0 0 0;
}

/* Feature Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 25px 0;
}

.feature-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(200, 200, 200, 0.3);
  border-radius: 6px;
  padding: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.feature-card h3 {
  color: #495057;
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Info Boxes */
.info-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 25px 0;
}

.info-box {
  background: rgba(248, 249, 250, 0.7);
  border: 1px solid rgba(200, 200, 200, 0.3);
  border-radius: 6px;
  padding: 18px;
  border-left: 3px solid #6c757d;
}

.info-box h4 {
  color: #495057;
  margin: 0 0 15px 0;
  font-size: 1rem;
  font-weight: 600;
}

.info-box ul {
  margin: 0;
  padding-left: 20px;
}

.info-box li {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Personal Notes */
.personal-note {
  background: rgba(248, 249, 250, 0.8);
  border: 1px solid rgba(200, 200, 200, 0.3);
  border-radius: 6px;
  padding: 15px 18px;
  margin: 20px 0;
  font-style: italic;
  border-left: 3px solid #6c757d;
}

.personal-note p {
  margin: 0;
  color: #495057;
}

/* Tips Section */
.tips-section {
  background: rgba(248, 249, 250, 0.8);
  border: 1px solid rgba(200, 200, 200, 0.3);
  border-radius: 6px;
  padding: 18px;
  margin: 20px 0;
  border-left: 3px solid #6c757d;
}

.tips-section h3 {
  color: #495057;
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.tips-section ol {
  margin: 0;
  padding-left: 20px;
}

.tips-section li {
  margin-bottom: 10px;
  line-height: 1.6;
}

/* FAQ Items */
.faq-item {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #f03;
}

.faq-item h4 {
  color: #2c3e50;
  margin: 0 0 8px 0;
  font-size: 1rem;
  font-weight: 600;
}

.faq-item p {
  margin: 0;
  color: #495057;
  line-height: 1.6;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 1024px) {
  .game-content {
    flex-direction: column;
    gap: 20px;
  }
  
  .game-controls {
    max-width: none;
    min-width: auto;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .game-container {
    margin: 8px;
    padding: 5px;
    border-radius: 6px;
  }
  
  .game-content {
    gap: 20px;
  }
  
  .shogi-board,
  .game-controls {
    padding: 10px;
    border-radius: 4px;
  }
  
  .control-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
  }
  
  /* DIFFICULTY SELECTOR VẪN GIỮ 2 CỘT TRÊN MOBILE */
  .difficulty-selector {
    grid-template-columns: 1fr 1fr; /* Giữ 2 cột */
    gap: 6px; /* Giảm khoảng cách một chút */
  }
  
  /* GAME BUTTONS VẪN GIỮ 2 CỘT TRÊN MOBILE */
  .game-buttons {
    grid-template-columns: 1fr 1fr; /* Giữ 2 cột */
    gap: 8px; /* Giảm khoảng cách một chút */
  }
  
  .seo-content {
    padding: 0 10px;
  }
  
  .main-article {
    padding: 15px;
  }
  
  .article-header h1 {
    font-size: 1.5rem;
  }
  
  .info-boxes {
    grid-template-columns: 1fr;
  }
  
  .status-display {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .game-container {
    margin: 0px;
    padding: 0px;
    border-radius: 4px;
  }
  
  .game-content {
    gap: 15px;
  }
  
  .shogi-board {
    padding: 8px;
    border-radius: 4px;
  }
  
  .game-controls {
    padding: 8px;
    border-radius: 4px;
    min-width: auto;
    max-width: none;
  }
  
  .game-controls .btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }
  
  /* DIFFICULTY BUTTONS VẪN GIỮ 2 CỘT NHƯNG GIẢM PADDING */
  .difficulty-btn {
    padding: 6px 4px; /* Giảm padding để vừa hơn */
    font-size: 0.7rem;
  }
  
  .difficulty-selector {
    gap: 4px; /* Giảm khoảng cách để vừa màn hình nhỏ hơn */
  }
  
  /* GAME BUTTONS VẪN GIỮ 2 CỘT NHƯNG GIẢM PADDING */
  .game-buttons {
    gap: 6px; /* Giảm khoảng cách */
  }
  
  .game-buttons .btn {
    padding: 8px 6px; /* Giảm padding */
    font-size: 0.75rem; /* Giảm font size */
  }
  
  .control-section h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }
  
  .status-display {
    padding: 8px;
  }
  
  .seo-content {
    padding: 0 8px;
  }
  
  .main-article {
    padding: 12px;
  }
  
  .article-header h1 {
    font-size: 1.3rem;
  }
  
  /* FIX: Bàn cờ full width trên mobile */
  shogi-player-wc {
    min-height: 350px;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* FIX: Con cờ full size */
  shogi-player-wc * {
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* ================================================
   MODAL GAME OVER
   ================================================ */

.game-over-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: 1000;
    inset: 0;
}

.game-over-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    animation: fadeIn 0.3s ease-out;
}

.game-over-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 15px 0;
}

.game-over-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.game-over-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ================================================
   ANIMATIONS
   ================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Button press animation */
.game-controls .btn:active {
  animation: buttonPress 0.1s ease;
}

@keyframes buttonPress {
  0% { transform: translateY(-1px) scale(1); }
  50% { transform: translateY(0) scale(0.98); }
  100% { transform: translateY(0) scale(1); }
}