:root { --bg: #147c2e; --card: #fff; --accent: #f9f871; --home-bg: #2c3e50; }
body { font-family: Inter, Arial, sans-serif; background: linear-gradient(#cfe6ff,#eaf6ff); margin:0; display:flex; align-items:center; justify-content:center; height:100vh; overflow:hidden; }

/* Remove body background for full screen modes */
body:has(.game-wrap #splash:not(.hide)), 
body:has(.game-wrap #home:not(.hide)), 
body:has(.game-wrap.playing) { 
  background: none; 
}
.game-wrap { width: 98vw; height: 96vh; max-width: 1200px; background: var(--bg); border-radius:12px; padding:12px; color:#fff; box-shadow:0 6px 18px rgba(0,0,0,.25); display:flex; flex-direction:column; }

/* Home page different background */
.game-wrap:has(#home:not(.hide)) { background: linear-gradient(135deg, var(--home-bg), #34495e); }

/* Full screen for splash */
.game-wrap:has(#splash:not(.hide)) { 
  width: 100vw; 
  height: 100vh; 
  max-width: none; 
  border-radius: 0; 
  padding: 0; 
  box-shadow: none; 
}

/* Full screen for home/start page */
.game-wrap:has(#home:not(.hide)) { 
  width: 100vw; 
  height: 100vh; 
  max-width: none; 
  border-radius: 0; 
  padding: 16px; 
  box-shadow: none; 
}

/* Full screen table when playing */
.game-wrap.playing { width: 100vw; height: 100vh; max-width: none; border-radius: 0; padding: 0; box-shadow: none; background: none; }
.game-wrap.playing body { background: none; }
header {display:flex; align-items:center; justify-content:space-between;}
h1 {margin:0; color:#ffdddd;}
.controls {display:flex; gap:10px; align-items:center;}
select,input[type=number] {padding:6px; border-radius:6px; border:0;}
button {padding:8px 12px; border-radius:8px; border:0; background:#fff; color:#222; cursor:pointer;}
small.note {
  display:block; 
  color:#fff; 
  margin-top:6px;
  background: linear-gradient(#0a7b27,#08651f);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  font-weight: 500;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.splash { 
  font-size: 2.7em; 
  padding: 0; 
  text-align: center; 
  color: #fff; 
  width: 100vw; 
  height: 100vh;
  background: linear-gradient(135deg, 
    #8B0000 0%, 
    #DC143C 15%, 
    #FF6347 30%, 
    #FF4500 45%, 
    #CD5C5C 60%, 
    #B22222 75%, 
    #8B0000 100%);
  background-size: 400% 400%;
  z-index: 9999;
  animation: splashGradient 4s ease infinite, splashPulse 2s ease-in-out infinite alternate;
  border-radius: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
}

.splash::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, 
    rgba(255,255,255,0.1) 0%, 
    rgba(255,69,0,0.2) 30%, 
    rgba(139,0,0,0.3) 70%, 
    rgba(0,0,0,0.4) 100%);
  animation: naturalGlow 3s ease-in-out infinite alternate;
}

.splash-content {
  position: relative;
  z-index: 2;
  text-shadow: 
    0 0 10px rgba(255,255,255,0.8),
    0 0 20px rgba(255,69,0,0.6),
    0 0 30px rgba(220,20,60,0.4),
    2px 2px 8px rgba(0,0,0,0.8);
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 30px 40px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  box-shadow: 
    0 0 30px rgba(255,255,255,0.2),
    inset 0 0 20px rgba(255,69,0,0.1),
    0 8px 32px rgba(0,0,0,0.3);
  animation: contentFloat 3s ease-in-out infinite alternate;
}

.version {
  font-size: 0.4em;
  color: rgba(255,255,255,0.9);
  margin-top: 15px;
  font-weight: normal;
  text-shadow: 
    0 0 5px rgba(255,255,255,0.6),
    1px 1px 3px rgba(0,0,0,0.7);
  letter-spacing: 2px;
}

@keyframes splashGradient {
  0% { background-position: 0% 50%; }
  25% { background-position: 100% 50%; }
  50% { background-position: 50% 100%; }
  75% { background-position: 0% 50%; }
  100% { background-position: 50% 0%; }
}

@keyframes splashPulse {
  0% { 
    transform: scale(1);
    filter: brightness(1) saturate(1);
  }
  100% { 
    transform: scale(1.02);
    filter: brightness(1.1) saturate(1.2);
  }
}

@keyframes naturalGlow {
  0% { 
    opacity: 0.7;
    transform: rotate(0deg) scale(1);
  }
  100% { 
    opacity: 1;
    transform: rotate(1deg) scale(1.05);
  }
}

@keyframes contentFloat {
  0% { 
    transform: translateY(0px) scale(1);
    text-shadow: 
      0 0 10px rgba(255,255,255,0.8),
      0 0 20px rgba(255,69,0,0.6),
      0 0 30px rgba(220,20,60,0.4),
      2px 2px 8px rgba(0,0,0,0.8);
  }
  100% { 
    transform: translateY(-8px) scale(1.02);
    text-shadow: 
      0 0 15px rgba(255,255,255,1),
      0 0 25px rgba(255,69,0,0.8),
      0 0 35px rgba(220,20,60,0.6),
      3px 3px 10px rgba(0,0,0,0.9);
  }
}
.hide {display:none;}



/* Game Rules Section */
.rules-section {
  margin-top: 16px;
  background: rgba(255,255,255,0.95);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  color: #2c3e50;
}

.rules-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.rules-column {
  background: linear-gradient(145deg, #f8f9fa, #e9ecef);
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid #28a745;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.rules-column:nth-child(2) {
  border-left-color: #ffc107;
}

.rules-column:nth-child(3) {
  border-left-color: #dc3545;
}

.rules-column h3 {
  margin: 0 0 12px 0;
  color: #2c3e50;
  font-size: 1.1em;
  font-weight: 600;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 8px;
}

.rules-column ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}

.rules-column li {
  margin-bottom: 8px;
  font-size: 0.9em;
  color: #495057;
}

.rules-column li strong {
  color: #2c3e50;
  font-weight: 600;
}

.rules-column li:last-child {
  margin-bottom: 0;
}

/* New Home Screen Horizontal Layout */
#home {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 15px;
  max-width: 100%;
  text-align: center;
}

#home.hide {
  display: none !important;
}

/* Home Logo - Same as splash screen */
.home-logo {
  font-size: 2em;
  color: #fff;
  text-align: center;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  line-height: 1.2;
}

.home-logo .version {
  font-size: 0.35em;
  margin-top: 8px;
  color: var(--accent);
  font-weight: normal;
}

/* Game Settings Section */
.game-settings {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(255,255,255,0.1);
  padding: 18px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
  justify-content: center;
  flex-wrap: wrap;
}

.setting-group {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
}

.game-settings label {
  color: #fff;
  font-weight: 600;
  font-size: 0.95em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.game-settings select {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: #fff;
  font-size: 0.9em;
  font-weight: 500;
}

#startBtn {
  background: var(--accent);
  color: #000;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(249, 248, 113, 0.3);
}

#startBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 248, 113, 0.4);
}

/* Home Controls Section */
.home-controls {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.08);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  color: #fff;
  font-size: 0.9em;
  font-weight: 600;
}

.control-group select,
.control-group button {
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  background: #fff;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-group button:hover {
  transform: scale(1.05);
}

/* Individual Rules Boxes - Horizontal Grid */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 1100px;
}

.rule-item {
  background: linear-gradient(135deg, rgba(44, 62, 80, 0.8), rgba(52, 73, 94, 0.7));
  padding: 15px;
  border-radius: 10px;
  color: #e8f4f8;
  font-size: 0.85em;
  line-height: 1.3;
  border: 1px solid rgba(249, 248, 113, 0.3);
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  text-align: left;
}

.rule-item:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(249, 248, 113, 0.2);
}

.rule-item strong:first-child {
  color: var(--accent);
  display: block;
  margin-bottom: 8px;
  font-size: 1.1em;
  text-align: center;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(249, 248, 113, 0.2), rgba(249, 248, 113, 0.1));
  border-radius: 6px;
  border: 1px solid rgba(249, 248, 113, 0.4);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  font-weight: bold;
}

.rule-content {
  text-align: left;
  margin: 0;
  padding: 0;
}

.rule-content p {
  margin: 8px 0;
  text-align: left;
  color: #e8f4f8;
  line-height: 1.4;
}

.rule-content p b {
  font-weight: bold;
}

/* Mission Section */
.mission-section {
  width: 100%;
  max-width: 800px;
}

.mission-text {
  background: rgba(249, 248, 113, 0.15);
  color: #fff;
  padding: 15px;
  border-radius: 10px;
  border: 2px solid var(--accent);
  font-size: 0.95em;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 3px 12px rgba(249, 248, 113, 0.2);
}

.mission-text b {
  color: var(--accent);
  font-size: 1.2em;
}

/* Responsive Design */
@media (max-width: 768px) {
  .home-logo {
    font-size: 1.6em;
  }
  
  .game-settings {
    flex-direction: column;
    gap: 12px;
    padding: 15px;
  }
  
  .home-controls {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
  }
  
  .rules-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .rule-item {
    padding: 10px;
    font-size: 0.8em;
  }
  
  #home {
    gap: 15px;
    padding: 12px;
  }
  
  .mission-text {
    font-size: 0.85em;
    padding: 12px;
  }
}

/* Cookie Banner Styles */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #1e243a, #2a3052);
  color: white;
  padding: 20px;
  box-shadow: 0 -2px 20px rgba(0,0,0,0.3);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner:not(.hidden) {
  transform: translateY(0);
}

.cookie-banner.hidden {
  transform: translateY(100%);
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.cookie-info h4 {
  margin: 0 0 8px 0;
  color: #0ef;
  font-size: 18px;
}

.cookie-info p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.cookie-info a {
  color: #0ef;
  text-decoration: none;
}

.cookie-info a:hover {
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-banner-actions .btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  min-width: 80px;
}

.btn-accept {
  background: #0ef;
  color: #1e243a;
}

.btn-accept:hover {
  background: #00d4e6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 239, 255, 0.3);
}

.btn-reject {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.btn-reject:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
}

.btn-manage {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

.btn-manage:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

/* Cookie Notification Styles */
.cookie-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  max-width: 300px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.cookie-notification.show {
  transform: translateX(0);
}

.cookie-notification.success {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.cookie-notification.info {
  background: linear-gradient(135deg, #17a2b8, #6610f2);
}

@media (max-width: 768px) {
  .cookie-banner-content {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .cookie-info {
    margin-bottom: 0;
  }
  
  .cookie-info h4 {
    font-size: 16px;
  }
  
  .cookie-info p {
    font-size: 13px;
  }
  
  .cookie-banner-actions {
    justify-content: center;
  }
  
  .cookie-banner-actions .btn {
    padding: 8px 16px;
    font-size: 13px;
    min-width: 70px;
  }
  
  .cookie-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}