/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #2D3748;
  background-color: #F7FAFC;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Simple Header */
.header {
  background: #4299E1;
  color: white;
  padding: 1rem 0;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header h1 {
  margin: 0;
  text-align: center;
}

/* Unified h3 spacing for room pages */
.join-section h3,
.player-info-section h3,
.game-section h3,
.game-start-section h3,
.seats-section h3,
.card-configuration-section h3,
.current-card-configuration-section h3,
.share-section h3 {
  margin-bottom: 0.5rem;
}

/* Unified h3 spacing for room pages */
.join-section h3,
.player-info-section h3,
.game-section h3,
.game-start-section h3,
.seats-section h3,
.card-configuration-section h3,
.current-card-configuration-section h3,
.share-section h3 {
  margin-bottom: 0.5rem;
}

.logo {
  color: white;
  text-decoration: none;
  font-size: 2rem;
  font-weight: 700;
  transition: color 0.2s ease;
}

.logo:hover {
  color: #f0f0f0;
}

/* Main Content */
.main {
  flex: 1;
  padding-bottom: 2rem;
}

/* Alerts */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  font-weight: 500;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Forms */

.form-group {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.form-input, .form-input-small {
  padding: 0.75rem;
  border: 1px solid #CBD5E0;
  border-radius: 6px;
  font-size: 1rem;
  background: white;
  color: #2D3748;
  transition: border-color 0.2s ease;
}

.form-input {
  flex: 1;
  min-width: 200px;
}

.form-input-small {
  width: 120px;
}

.form-input:focus, .form-input-small:focus {
  outline: none;
  border-color: #4299E1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Simple Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: #4299E1;
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  background: #3182CE;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: #EDF2F7;
  color: #4A5568;
  border: 1px solid #CBD5E0;
}

.btn-secondary:hover {
  background: #E2E8F0;
  color: #2D3748;
}

.btn-seat {
  background: #718096;
  color: white;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.btn-seat:hover {
  background: #4A5568;
  text-decoration: none;
  color: white;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Special Action Buttons */
.btn-main-action, .btn-start-game, .btn-go-game {
  background: #4299E1;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-main-action:hover, .btn-start-game:hover, .btn-go-game:hover {
  background: #3182CE;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: white;
}

.btn-secondary-action {
  background: #EDF2F7;
  color: #4A5568;
  border: 1px solid #CBD5E0;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-secondary-action:hover {
  background: #E2E8F0;
  color: #2D3748;
  text-decoration: none;
}

.btn-shuffle {
  background: #805AD5;
  color: white;
  border: 1px solid #6B46C1;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-shuffle:hover {
  background: #6B46C1;
  color: white;
  text-decoration: none;
}

.shuffle-section {
  text-align: center;
  margin: 1rem 0;
}

/* Rooms Index */
.rooms-index h2 {
  color: #495057;
  margin-bottom: 1.5rem;
  text-align: center;
}

.room-form {
  background: white;
  border: 1px solid #E2E8F0;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.rooms-list h3 {
  color: #495057;
  margin-bottom: 1rem;
}

.room-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.room-info h4 {
  color: #495057;
  margin-bottom: 0.5rem;
}

.player-count {
  color: #6c757d;
  font-size: 0.9rem;
}

.status {
  background-color: #28a745;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.join-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #6c757d;
}

/* Room Show */
.room-show h2 {
  color: #495057;
  margin-bottom: 1rem;
}

.room-status {
  color: #6c757d;
  margin-bottom: 2rem;
}

.join-section, .player-info-section, .game-section, .game-start-section {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.game-start-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #495057;
  text-align: center;
  border: 2px solid #28a745;
}

.game-start-section h3 {
  color: #28a745;
  margin-bottom: 1rem;
  font-weight: bold;
}

.game-start-section p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.seats-section {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.seats-grid {
  position: relative;
  width: min(500px, 95vw);
  height: min(500px, 95vw);
  margin: 0 auto;
  max-width: 100%;
}

.seat {
  position: absolute;
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  width: min(200px, 38vw);
  height: min(160px, 30vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.seat-east {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.seat-south {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.seat-west {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.seat-north {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.seat.occupied {
  background: #4299E1;
  color: white;
  border-color: #3182CE;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.seat.current-player {
  background: #48BB78;
  color: white;
  border-color: #38A169;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.seat-label {
  font-weight: bold;
  font-size: clamp(1rem, 4vw, 1.5rem);
  margin-bottom: 0.8rem;
}

.seat .player-name {
  font-size: 1rem;
  opacity: 0.9;
}

.seat-empty {
  color: #6c757d;
  font-size: 1rem;
}

/* 空席の背景色を明示的に設定 */
.seat:not(.occupied) {
  background: #f8f9fa !important;
  border-color: #e0e6ed !important;
}

/* 座席ラベル（東南西北）の文字色は濃い色を保持 */
.seat-label {
  color: #333 !important;
}

/* 空席テキストのみ薄いグレー */
.seat-empty {
  color: #6c757d !important;
}

/* 空席内の座るボタンや空席テキストがある場合 */
.seat .seat-empty,
.seat form {
  background: transparent;
}

.notice {
  color: #856404;
  background-color: #fff3cd;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #ffeaa7;
}

/* Card Configuration Styles */
.card-configuration-section {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.card-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card-config-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-config-item label {
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
}

.form-select {
  padding: 0.5rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: white;
  font-size: 0.9rem;
  color: #495057;
}

.form-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.card-summary {
  padding: 1.5rem;
  margin-top: 0.7rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.card-summary h4 {
  margin: 0 0 1rem 0;
  color: #495057;
  font-size: 1rem;
}

.card-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.card-summary-item {
  background: #e9ecef;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #495057;
}

.total-cards {
  margin: 0;
  font-weight: 600;
  color: #495057;
}

/* Current Card Configuration Section - 他のセクションと統一したスタイル */
.current-card-configuration-section {
  background: white;
  border: 1px solid #E2E8F0;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.current-card-configuration-section h3 {
  color: #495057;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Add Card Form Styles */
.add-card-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.add-card-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.add-card-form .form-input {
  flex: 1;
  padding: 0.5rem;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 0.9rem;
}

.add-card-form .form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.card-config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.delete-card-btn {
  color: #dc3545;
  text-decoration: none;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.delete-card-btn:hover {
  background-color: #f8d7da;
  color: #721c24;
}

.no-cards-message {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  margin: 2rem 0;
}

@media (max-width: 768px) {
  .add-card-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .card-config-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* Game Show */
.game-show h2 {
  color: #495057;
  margin-bottom: 0.6rem;
}

.game-status {
  color: #28a745;
  font-weight: bold;
  margin-bottom: 1rem;
}

.game-seats-section {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.game-seats-grid {
  position: relative;
  width: min(500px, 95vw);
  height: min(500px, 95vw);
  margin: 0 auto;
  max-width: 100%;
}

.game-seat {
  position: absolute;
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  width: min(200px, 38vw);
  height: min(160px, 30vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.game-seat-top {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.game-seat-left {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.game-seat-bottom {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.game-seat-right {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.game-seat.current-player-seat {
  background: #48BB78;
  color: white;
  border-color: #38A169;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.game-seat .player-name {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.game-seat .card-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #dc3545;
}

.game-seat.current-player-seat .card-number {
  color: white;
  font-size: 2rem;
}

.game-actions {
  text-align: center;
  margin-bottom: 2rem;
}

/* Game Reveal */
.game-reveal h2 {
  color: #495057;
  margin-bottom: 0.6rem;
}

.waiting-section {
  background: white;
  padding: 3rem 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  text-align: center;
  margin-bottom: 2rem;
}

.loading-spinner {
  font-size: 2rem;
  margin-top: 1rem;
}

.waiting-message {
  text-align: center;
  padding: 2rem;
  margin-bottom: 2rem;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  color: #856404;
}

.waiting-message h3 {
  color: #856404;
  margin-bottom: 1rem;
}

.reveal-seats-section {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}

.reveal-seats-section.hidden {
  display: none;
}

.reveal-seats-grid {
  position: relative;
  width: min(500px, 95vw);
  height: min(500px, 95vw);
  margin: 0 auto;
  max-width: 100%;
}

.reveal-seat {
  position: absolute;
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  width: min(200px, 38vw);
  height: min(160px, 30vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reveal-seat-top {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.reveal-seat-left {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.reveal-seat-bottom {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.reveal-seat-right {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
}

.reveal-seat.current-player-seat {
  background: #48BB78;
  color: white;
  border-color: #38A169;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reveal-seat .player-name {
  font-weight: bold;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.reveal-seat .card-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: #dc3545;
}

.reveal-seat.current-player-seat .card-number {
  color: white;
  font-size: 2rem;
}

.game-result {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
  color: white;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.game-result h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.winner {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0.5rem 0;
}

.tie {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

.next-game-actions {
  text-align: center;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.share-section {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.qr-code-container {
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.qr-code-container svg {
  width: 200px;
  height: 200px;
  border: 1px solid #e0e6ed;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
  background: white;
  padding: 10px;
}

.share-info {
  text-align: center;
}

.share-url {
  background: #f8f9fa;
  padding: 0.75rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.9rem;
  word-break: break-all;
  margin-bottom: 1rem;
  border: 1px solid #e0e6ed;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.back-link {
  text-align: center;
  margin-top: 2rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .header {
    margin-bottom: 1rem;
  }
  
  .logo {
    font-size: 1.7rem;
  }
  
  .form-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .form-input, .form-input-small {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .room-card {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .join-form {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .seat {
    padding: clamp(0.8rem, 3vw, 1.2rem);
  }
  
  .game-seat {
    padding: clamp(0.8rem, 3vw, 1.2rem);
  }
  
  .reveal-seat {
    padding: clamp(0.8rem, 3vw, 1.2rem);
  }
  
  .game-seat .card-number {
    font-size: clamp(1.3rem, 4vw, 1.3rem);
  }
  
  .game-seat.current-player-seat .card-number {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }
  
  .reveal-seat .card-number {
    font-size: clamp(1.3rem, 4vw, 1.3rem);
  }
  
  .reveal-seat.current-player-seat .card-number {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }
  
  .other-players {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .other-player {
    padding: 0.75rem;
  }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .player-card {
    padding: 1rem;
  }
  
  .card {
    width: 60px;
    height: 90px;
    font-size: 1.2rem;
  }
  
  .next-game-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .btn-large {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.5rem;
  }
  
  .room-form, .join-section, .player-info-section, .game-section, .share-section, .seats-section, .game-seats-section, .reveal-seats-section, .game-board, .all-cards, .card-configuration-section, .current-card-configuration-section {
    padding: 1rem;
  }
  
  .card-summary, .add-card-section {
    padding: 1rem;
  }
  
  .qr-code-container svg {
    width: 150px;
    height: 150px;
  }
  
  .share-buttons {
    justify-content: center;
  }
  
  .seat {
    padding: clamp(0.5rem, 2.5vw, 1rem);
  }
  
  .game-seat {
    padding: clamp(0.5rem, 2.5vw, 1rem);
  }
  
  .reveal-seat {
    padding: clamp(0.5rem, 2.5vw, 1rem);
  }
  
  .other-players {
    grid-template-columns: 1fr;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .card {
    width: 50px;
    height: 75px;
    font-size: 1rem;
  }
}

/* Welcome Section */
.welcome-section {
  margin: 0rem 0 2rem 0;
  padding: 2rem;
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: left;
  margin-right: auto;
}

.welcome-section p {
  margin: 1rem 0;
  color: #4A5568;
  line-height: 1.6;
  font-size: 1rem;
  font-weight: 400;
}

.welcome-section p:first-child {
  margin-top: 0;
  color: #2D3748;
  font-weight: 600;
  font-size: 1.125rem;
}

.welcome-section p:last-child {
  margin-bottom: 1.5rem;
}

.rooms-index {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem;
}

/* Simple Rules Button */
.rules-btn {
  background: #EDF2F7;
  color: #4A5568;
  border: 1px solid #CBD5E0;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  border-radius: 6px;
  font-weight: 400;
  transition: all 0.2s ease;
}

.rules-btn:hover {
  background: #E2E8F0;
  color: #2D3748;
}

.btn-outline {
  background: transparent;
  color: #D53F8C;
  border: 2px solid #D53F8C;
}

.btn-outline:hover {
  background: #D53F8C;
  color: white;
  transform: translateY(-2px);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: slideIn 0.3s;
}

.modal-content-card-style {
  background-color: white;
  margin: 5% auto;
  padding: 1rem;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  animation: slideIn 0.3s;
  border: 1px solid #e9ecef;
}

/* Rules Modal - current-card-configuration-sectionと完全に同じデザイン */
.rules-modal-content {
  background: white;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideIn 0.3s;
  position: relative;
  margin-bottom: 2rem;
}

.rules-modal-content h3 {
  color: #495057;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.rules-modal-content .modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.8rem;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
  transition: opacity 0.3s;
  color: #6c757d;
}

.rules-modal-content .modal-close:hover {
  opacity: 0.7;
}

.rules-content {
  text-align: left;
}

.rules-content h3 {
  color: #495057;
  margin: 1.5rem 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.rules-content h3:first-child {
  margin-top: 0;
}

.rules-content ul, .rules-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.rules-content li {
  margin: 0.5rem 0;
  line-height: 1.6;
  color: #495057;
}

/* Rules Modal内のcard-summaryの調整 */
.rules-modal-content .card-summary {
  margin-top: 0;
}

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

.modal-header {
  padding: 1.5rem 2rem;
  background: #4299E1;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

/* Simple modal header like card configuration section */
.modal-header-simple {
  padding: 1.5rem 2rem;
  background: white;
  color: #495057;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e9ecef;
}

.modal-header-simple h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #495057;
}

/* Card-style modal header */
.modal-header-card-style {
  padding: 1rem;
  background: white;
  color: #495057;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: none;
}

.modal-header-card-style h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #495057;
}

.modal-close {
  font-size: 2rem;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
  transition: opacity 0.3s;
  color: white;
}

.modal-close:hover {
  opacity: 0.7;
}

.modal-header-simple .modal-close {
  color: #6c757d;
}

/* reveal.html.erbのclose buttonスタイル */
.close {
  color: white;
  float: right;
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.close:hover {
  opacity: 0.7;
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  max-height: calc(80vh - 120px);
  text-align: left;
}

.modal-body-left-aligned {
  padding: 2rem;
  overflow-y: auto;
  max-height: calc(80vh - 120px);
  text-align: left;
}

.modal-body-card-style {
  padding: 1rem;
  overflow-y: auto;
  max-height: calc(80vh - 120px);
  text-align: left;
  background: white;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin: 0;
}

.modal-body h3 {
  color: #495057;
  margin: 1.5rem 0 1rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body ul, .modal-body ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.modal-body li {
  margin: 0.5rem 0;
  line-height: 1.6;
  color: #495057;
}

.modal-body ul li {
  list-style-type: disc;
}

.modal-body ol li {
  list-style-type: decimal;
}

/* Mobile Modal Styles */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10% auto;
    max-height: 75vh;
  }
  
  .modal-header {
    padding: 1rem 1.5rem;
  }
  
  .modal-header h2 {
    font-size: 1.1rem;
  }
  
  .modal-header-simple {
    padding: 1rem 1.5rem;
  }
  
  .modal-header-simple h3 {
    font-size: 1.1rem;
  }
  
  .modal-header-card-style {
    padding: 0.75rem;
  }
  
  .modal-header-card-style h3 {
    font-size: 0.9rem;
  }
  
  .modal-body {
    padding: 1.5rem;
    max-height: calc(75vh - 100px);
  }
  
  .modal-body-left-aligned {
    padding: 1.5rem;
    max-height: calc(75vh - 100px);
  }
  
  .modal-body-card-style {
    padding: 0.75rem;
    max-height: calc(75vh - 100px);
  }
  
  .modal-body h3 {
    font-size: 1rem;
  }
  
  .modal-close {
    font-size: 1.5rem;
  }
  
  /* Rules Modal Mobile */
  .rules-modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 1.5rem;
    max-height: 75vh;
  }
  
  .rules-modal-content h3 {
    font-size: 1rem;
  }
  
  .rules-modal-content .modal-close {
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
  }
  
  .rules-content h3 {
    font-size: 0.9rem;
  }
}
