/**
 * Gamesdle DriveTest - Shared Psychotechnical Driving Simulators Stylesheet
 */
html, body {
  margin: 0; padding: 0;
  background-color: #f1f5f9;
  font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
  color: #0f172a;
  touch-action: manipulation;
  overscroll-behavior-x: none;
  overflow-x: hidden;
  max-width: 100vw;
}

header { margin: 0 auto; text-align: center; padding: 10px 0; }
.responsive { max-width: 90%; height: auto; margin: 0 auto; display: block; }

.game-title {
  text-align: center; margin: 10px 0 4px 0;
  font-family: 'Fredoka', cursive, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700; font-size: 31px; color: #0f172a;
}

.game-subtitle {
  text-align: center; margin: 0 0 10px 0; padding: 0 12px;
  font-size: 0.95rem; color: #475569; font-weight: 500;
}

/* Flag Language Switcher */
.gamesdle-lang-bar {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 7px; max-width: 580px; margin: 6px auto 12px auto; padding: 0 10px; direction: ltr;
}
.gamesdle-lang-bar .lang-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: 99px; background: #ffffff; border: 1.5px solid #cbd5e1; color: #334155;
  font-family: 'Fredoka', sans-serif; font-size: 0.8rem; font-weight: 600; text-decoration: none;
  transition: all 0.15s ease;
}
.gamesdle-lang-bar .lang-pill:hover { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; text-decoration: none; }
.gamesdle-lang-bar .lang-pill.active { background: #0f172a; border-color: #3b82f6; color: #ffffff; }
.gamesdle-lang-bar .flag-svg { width: 21px; height: 14px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,0.12); }

/* Main Simulator Container */
.drive-container {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 580px; margin: 0 auto 22px auto; padding: 0 12px; box-sizing: border-box;
}

.drive-hud {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; max-width: 540px; background: #ffffff;
  border: 1.5px solid #cbd5e1; border-radius: 16px; padding: 10px 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06); box-sizing: border-box; margin-bottom: 10px;
}

.hud-stat { display: flex; flex-direction: column; align-items: center; }
.hud-stat span { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: #64748b; }
.hud-stat strong { font-family: 'Fredoka', sans-serif; font-size: 1.25rem; color: #1d4ed8; }

.drive-status {
  width: 100%; max-width: 540px; text-align: center; font-family: 'Fredoka', sans-serif;
  font-size: 0.96rem; font-weight: 600; color: #1e3a8a; background: #dbeafe;
  border: 1.5px solid #93c5fd; border-radius: 12px; padding: 8px 14px;
  margin-bottom: 10px; box-sizing: border-box;
}
.drive-status.pass { background: #d1fae5; border-color: #34d399; color: #065f46; }
.drive-status.warn { background: #fee2e2; border-color: #f87171; color: #991b1b; }

.canvas-stage {
  width: 100%; max-width: 540px; display: flex; justify-content: center; position: relative;
}

#gameCanvas {
  width: 100%; display: block; border-radius: 18px;
  background: #0f172a;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28), 0 0 0 2px #334155;
  touch-action: none; user-select: none; -webkit-user-select: none;
}

/* Big Action Buttons & Pads */
.drive-action-row {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  width: 100%; max-width: 540px; margin-top: 12px;
}

.drive-btn {
  flex: 1; min-width: 120px; padding: 13px 18px; border-radius: 14px; border: none;
  font-family: 'Fredoka', sans-serif; font-size: 1.1rem; font-weight: 700; cursor: pointer;
  color: #ffffff; background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3); transition: transform 0.1s ease;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.drive-btn:active { transform: scale(0.96); }
.drive-btn.danger { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 6px 16px rgba(220, 38, 38, 0.32); }
.drive-btn.success { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.32); }
#gasBtn, #brakeBtn {
  min-height: 86px;
  padding: 22px 14px;
  font-size: 1.25rem;
  border-radius: 18px;
  flex: 1 1 44%;
  letter-spacing: 0.3px;
}
.drive-btn.secondary { background: #ffffff; color: #1e293b; border: 1.5px solid #cbd5e1; box-shadow: none; font-size: 0.95rem; padding: 10px 14px; flex: 0 1 auto; }
.drive-btn.secondary.active { background: #1d4ed8; color: #ffffff; border-color: #1d4ed8; }

/* Bimanual Dual Sliders */
.bimanual-pads {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  width: 100%; max-width: 540px; margin-top: 12px;
}
.touch-pad {
  display: flex; align-items: center; justify-content: center;
  min-height: 96px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 2.5px solid #475569; border-radius: 18px;
  padding: 18px 10px; text-align: center; color: #f8fafc;
  font-family: 'Fredoka', sans-serif; font-size: 1rem; font-weight: 700;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: ew-resize;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.touch-pad.active-touch {
  border-color: #38bdf8;
  background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%);
}

/* Stress MPU Pads */
.mpu-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  width: 100%; max-width: 540px; margin-top: 12px;
}
.mpu-pad {
  padding: 16px 6px; border-radius: 14px; border: 2px solid rgba(255,255,255,0.25);
  color: #ffffff; font-family: 'Fredoka', sans-serif; font-size: 1rem; font-weight: 700;
  cursor: pointer; user-select: none; touch-action: manipulation; transition: transform 0.08s;
}
.mpu-pad:active { transform: scale(0.93); }
.mpu-red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.mpu-yellow { background: linear-gradient(135deg, #eab308, #a16207); }
.mpu-green { background: linear-gradient(135deg, #22c55e, #15803d); }
.mpu-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.mpu-sub-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  width: 100%; max-width: 540px; margin-top: 8px;
}
.mpu-dark { background: #1e293b; border-color: #64748b; font-size: 0.88rem; padding: 12px 6px; }

/* Landolt C 4-Direction Pad */
.landolt-dpad {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  width: 100%; max-width: 540px; margin-top: 12px;
}
.landolt-btn {
  padding: 18px 8px; border-radius: 14px; border: 2px solid #cbd5e1;
  background: #ffffff; color: #0f172a; font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08); transition: transform 0.08s;
  user-select: none; touch-action: manipulation;
}
.landolt-btn:active { transform: scale(0.93); background: #eff6ff; border-color: #3b82f6; }

/* Report / Certificate Card */
.report-card {
  display: none; width: 100%; max-width: 540px; margin-top: 14px;
  background: #ffffff; border: 2px solid #3b82f6; border-radius: 18px;
  padding: 20px; text-align: center; box-sizing: border-box;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
}
.report-card.show { display: block; }
.report-badge {
  display: inline-block; padding: 5px 14px; border-radius: 99px;
  font-family: 'Fredoka', sans-serif; font-size: 0.95rem; font-weight: 700;
  background: #d1fae5; color: #065f46; margin-bottom: 8px;
}
.report-badge.fail { background: #fee2e2; color: #991b1b; }
.report-card h3 { font-family: 'Fredoka', sans-serif; font-size: 1.5rem; margin: 4px 0 8px 0; color: #0f172a; }
.report-card p { font-size: 0.96rem; color: #475569; margin: 0 0 14px 0; line-height: 1.5; }

/* Disclaimer */
.drive-disclaimer {
  max-width: 600px; margin: 14px auto; padding: 10px 14px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px;
  font-size: 0.82rem; color: #92400e; text-align: center; line-height: 1.45; box-sizing: border-box;
}

/* Driving Hub */
.gamesdle-driving-hub {
  max-width: 680px; margin: 20px auto 25px auto; padding: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  border: 1px solid #3b82f6; border-radius: 18px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
  box-sizing: border-box; color: #ffffff; font-family: 'Fredoka', sans-serif; clear: both;
}
.gamesdle-driving-hub .dhub-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gamesdle-driving-hub .dhub-title { font-size: 1.1rem; font-weight: 600; color: #eff6ff; margin: 0; }
.gamesdle-driving-hub .dhub-badge { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; background: #3b82f6; color: #ffffff; padding: 3px 9px; border-radius: 12px; }
.gamesdle-driving-hub .dhub-cards-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.gamesdle-driving-hub .dhub-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px; padding: 11px 6px; text-decoration: none; transition: all 0.2s ease;
}
.gamesdle-driving-hub .dhub-card:hover { background: rgba(59,130,246,0.28); border-color: #93c5fd; transform: translateY(-2px); text-decoration: none; }
.gamesdle-driving-hub .dhub-card.active { background: rgba(59,130,246,0.34); border-color: #60a5fa; }
.gamesdle-driving-hub .dhub-card-icon { font-size: 1.55rem; margin-bottom: 4px; line-height: 1; }
.gamesdle-driving-hub .dhub-card-name { font-size: 0.85rem; font-weight: 600; color: #f8fafc; line-height: 1.2; }
.gamesdle-driving-hub .dhub-card-tag { font-family: sans-serif; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; color: #93c5fd; margin-top: 3px; }

/* SEO Section */
article.seo-section {
  max-width: 600px; margin: 26px auto 40px auto; padding: 24px 22px; background: #ffffff;
  border-radius: 20px; box-shadow: 0 8px 30px rgba(30, 41, 59, 0.07); border: 1px solid #cbd5e1;
  box-sizing: border-box; color: #334155; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-align: left;
}
article.seo-section .section-header { margin-top: 1.8rem; margin-bottom: 0.7rem; }
article.seo-section .section-header:first-of-type { margin-top: 0.2rem; }
article.seo-section .seo-tag {
  display: inline-flex; align-items: center; gap: 5px; font-family: 'Fredoka', sans-serif; font-size: 0.8rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; background: #eff6ff; color: #1d4ed8;
  padding: 4px 12px; border-radius: 20px; margin-bottom: 6px;
}
article.seo-section h2 { font-family: 'Fredoka', sans-serif; font-size: 1.42rem; font-weight: 600; color: #0f172a; margin: 4px 0 10px 0; }
article.seo-section p { font-size: 0.96rem; line-height: 1.7; margin: 0 0 1rem 0; color: #475569; }
article.seo-section .faq-container { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
article.seo-section .faq-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 14px 16px; }
article.seo-section .faq-card h3 { font-family: 'Fredoka', sans-serif; margin: 0 0 6px 0; font-size: 1rem; font-weight: 600; color: #1e293b; }
article.seo-section .faq-card p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: #475569; }

@media (max-width: 500px) {
  .game-title { font-size: 25px; }
  .gamesdle-driving-hub .dhub-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .mpu-grid, .mpu-sub-grid { grid-template-columns: repeat(2, 1fr); }
  article.seo-section { margin: 20px 10px 35px 10px; padding: 18px 14px; }
}

/* AdSense Banners */
.ad-banner-wrapper { max-width: 728px; width: 95%; min-height: 90px; margin: 14px auto; text-align: center; overflow: hidden; box-sizing: border-box; }
.side-banner { display: none; position: fixed; top: 100px; width: 160px; height: 600px; z-index: 40; text-align: center; }
.side-banner-left { left: 12px; }
.side-banner-right { right: 12px; }
@media (min-width: 1140px) { .side-banner { display: block; } }
