/**
 * VLIKE Guest Guard — Verification Games Stylesheet
 * File: guard-games.css | Scope: .vgg-shell (Day & [data-theme="night"])
 * Prefix: .vgg-* | Tokens: --vgg-*
 */
.vgg-shell {
  --vgg-cobalt: #2738E8;
  --vgg-cobalt-dark: #1622B8;
  --vgg-cobalt-light: #4454F5;
  --vgg-cobalt-soft: #EEF0FD;
  --vgg-yellow: #F5DE67;
  --vgg-yellow-dark: #D97706;
  --vgg-yellow-soft: #FEF9C3;
  --vgg-yellow-glow: rgba(245, 222, 103, 0.45);
  --vgg-green: #10B981;
  --vgg-green-dark: #059669;
  --vgg-green-soft: #D1FAE5;
  --vgg-green-glow: rgba(16, 185, 129, 0.35);
  --vgg-red: #EF4444;
  --vgg-red-soft: #FEE2E2;

  --vgg-bg: #F7F8FC;
  --vgg-card-bg: #FFFFFF;
  --vgg-card-border: #E2E8F0;
  --vgg-card-shadow: 0 16px 36px -8px rgba(20, 27, 45, 0.08), 0 4px 12px -2px rgba(20, 27, 45, 0.04);
  --vgg-ink: #141B2D;
  --vgg-ink-secondary: #526179;
  --vgg-ink-tertiary: #94A3B8;

  --vgg-tag-color: var(--vgg-cobalt);
  --vgg-tag-bg: var(--vgg-cobalt-soft);
  --vgg-badge-easy-color: var(--vgg-green-dark);
  --vgg-badge-easy-bg: var(--vgg-green-soft);
  --vgg-status-info-color: var(--vgg-cobalt-dark);
  --vgg-status-info-bg: var(--vgg-cobalt-soft);
  --vgg-arrow-done-color: var(--vgg-cobalt);
  --vgg-arrow-done-bg: var(--vgg-cobalt-soft);
  --vgg-link-color: var(--vgg-cobalt);

  --vgg-board-bg: #0F172A;
  --vgg-board-border: #1E293B;
  --vgg-cell-empty: #1E293B;
  --vgg-cell-filled: #2738E8;
  --vgg-cell-active: #F5DE67;
  --vgg-cell-ghost: rgba(245, 222, 103, 0.22);
  --vgg-cell-ghost-border: rgba(245, 222, 103, 0.65);
  --vgg-cell-target: rgba(56, 189, 248, 0.2);
  --vgg-cell-target-border: #38BDF8;

  --vgg-track-bg: #0F172A;
  --vgg-track-border: #1E293B;
  --vgg-beat-zone: rgba(16, 185, 129, 0.28);
  --vgg-beat-zone-border: #10B981;
  --vgg-cursor: #FFFFFF;
  --vgg-beat-progress: 0.52;

  --vgg-focus-ring: 0 0 0 3px rgba(39, 56, 232, 0.35);
  --vgg-radius-sm: 8px;
  --vgg-radius-md: 14px;
  --vgg-radius-lg: 20px;
  --vgg-radius-xl: 28px;
  --vgg-radius-pill: 9999px;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Be Vietnam Pro", sans-serif;
  color: var(--vgg-ink);
  background-color: var(--vgg-bg);
  min-height: 100vh;
  padding: clamp(20px, 4vw, 48px) 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  line-height: 1.5;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

/* Production integration: native site theme, exact mobile mark and active-only games. */
.vgg-shell .vgg-mobile-logo{display:block;object-fit:contain;background:#fff;border-radius:8px;padding:2px;width:48px;height:32px}
.vgg-shell .vgg-start{width:100%;min-height:48px}
.vgg-shell button:disabled{opacity:.5;cursor:not-allowed;transform:none}
.vgg-shell .vgg-status-error{color:#B42318;background:#FFF1F0}
.vgg-shell .vgg-status-success{color:#166534;background:#DCFCE7}
.vgg-shell[data-theme="night"] .vgg-status-error{color:#FFB4AB;background:#391E2B}
.vgg-shell[data-theme="night"] .vgg-status-success{color:#86EFAC;background:#103527}
.vgg-shell .vgg-board{touch-action:pan-y;cursor:grab;outline-offset:6px}
.vgg-shell .vgg-board.is-dragging{cursor:grabbing}
.vgg-shell .vgg-board.is-complete .vgg-cell.is-filled{background:#15803D}
.vgg-shell [data-vgg-beat]{contain:layout paint}
.vgg-shell [data-vgg-beat].is-ready{box-shadow:0 0 0 3px #10B98140}
.vgg-shell .vgg-footer p{margin-top:12px}
.vgg-shell .vgg-methods:has(> :only-child){grid-template-columns:1fr}
.vgg-shell :focus-visible{outline:2px solid var(--vgg-link-color);outline-offset:3px}
@media(max-width:480px){.vgg-shell .vgg-controls-tetris{grid-template-columns:44px 44px 1fr 44px;gap:5px}.vgg-shell .vgg-controls-tetris .vgg-btn{padding:0 5px;font-size:12px}.vgg-shell .vgg-stage{padding:18px 14px}.vgg-shell .vgg-stage-header{align-items:flex-start}}
@media(prefers-reduced-motion:reduce){.vgg-shell .vgg-beat-cursor{transition:none}.vgg-shell [data-vgg-beat] .vgg-beat-cursor{display:none}.vgg-shell [data-vgg-beat].is-ready .vgg-beat-zone{background:#157C54;color:#fff}.vgg-shell [data-vgg-beat].is-ready::after{content:'CHỐT NHỊP';position:absolute;inset:0;display:grid;place-items:center;color:#fff;background:#157C54;font-weight:800}}

.vgg-shell[data-theme="night"],
[data-theme="night"] .vgg-shell {
  --vgg-bg: #0B1120;
  --vgg-card-bg: #152039;
  --vgg-card-border: #243354;
  --vgg-card-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.6);
  --vgg-ink: #F3F6FC;
  --vgg-ink-secondary: #B9C6DB;
  --vgg-ink-tertiary: #64748B;
  --vgg-focus-ring: 0 0 0 3px rgba(68, 84, 245, 0.45);
  --vgg-tag-color: #7DD3FC;
  --vgg-tag-bg: rgba(39, 56, 232, 0.3);
  --vgg-badge-easy-color: #6EE7B7;
  --vgg-badge-easy-bg: rgba(16, 185, 129, 0.2);
  --vgg-status-info-color: #93C5FD;
  --vgg-status-info-bg: rgba(39, 56, 232, 0.22);
  --vgg-arrow-done-color: #93C5FD;
  --vgg-arrow-done-bg: rgba(39, 56, 232, 0.3);
  --vgg-link-color: #7DD3FC;
}

.vgg-shell [hidden] { display: none !important; }
.vgg-shell *, .vgg-shell *::before, .vgg-shell *::after { box-sizing: border-box; margin: 0; padding: 0; }

.vgg-shell .vgg-container {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Brand Header */
.vgg-shell .vgg-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; }
.vgg-shell .vgg-brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--vgg-ink); font-weight: 900; font-size: 1.25rem; letter-spacing: -0.03em; }
.vgg-shell .vgg-brand-flag { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 16px; background: #DA251D; border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.vgg-shell .vgg-brand-flag::after { content: "★"; color: #FFFF00; font-size: 11px; line-height: 1; }
.vgg-shell .vgg-brand-tag { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--vgg-tag-color); background: var(--vgg-tag-bg); padding: 3px 8px; border-radius: var(--vgg-radius-pill); }
.vgg-shell .vgg-theme-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; color: var(--vgg-ink-secondary); background: none; border: 1px solid var(--vgg-card-border); padding: 6px 12px; border-radius: var(--vgg-radius-pill); cursor: pointer; min-height: 36px; transition: all 0.16s; }
.vgg-shell .vgg-theme-btn:hover { background: rgba(0, 0, 0, 0.04); color: var(--vgg-ink); }
.vgg-shell[data-theme="night"] .vgg-theme-btn:hover, [data-theme="night"] .vgg-shell .vgg-theme-btn:hover { background: rgba(255, 255, 255, 0.08); }

/* Intro */
.vgg-shell .vgg-card-intro { text-align: center; padding: 4px 8px 12px; }
.vgg-shell .vgg-title { font-size: clamp(1.4rem, 3.2vw, 1.85rem); font-weight: 900; letter-spacing: -0.025em; color: var(--vgg-ink); line-height: 1.25; margin-bottom: 8px; }
.vgg-shell .vgg-desc { font-size: 0.9375rem; color: var(--vgg-ink-secondary); max-width: 480px; margin: 0 auto; line-height: 1.55; }

/* Method Selection Cards */
.vgg-shell .vgg-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 4px; }
.vgg-shell .vgg-method-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background-color: var(--vgg-card-bg); border: 2px solid var(--vgg-card-border); border-radius: var(--vgg-radius-lg); cursor: pointer; text-align: left; transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s; min-height: 84px; }
.vgg-shell .vgg-method-card:hover { border-color: var(--vgg-cobalt-light); transform: translateY(-1.5px); }
.vgg-shell .vgg-method-card.is-selected, .vgg-shell .vgg-method-card[aria-pressed="true"] { border-color: var(--vgg-cobalt); box-shadow: 0 0 0 1px var(--vgg-cobalt), 0 8px 20px -4px rgba(39, 56, 232, 0.18); }
.vgg-shell .vgg-method-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.vgg-shell .vgg-method-name { font-size: 0.9375rem; font-weight: 800; color: var(--vgg-ink); display: flex; align-items: center; gap: 6px; }
.vgg-shell .vgg-badge { display: inline-flex; align-items: center; font-size: 0.6875rem; font-weight: 700; padding: 2px 7px; border-radius: var(--vgg-radius-pill); text-transform: uppercase; letter-spacing: 0.04em; color: var(--vgg-badge-easy-color); background-color: var(--vgg-badge-easy-bg); }
.vgg-shell .vgg-method-desc { font-size: 0.75rem; color: var(--vgg-ink-secondary); line-height: 1.4; }

/* Status Bar */
.vgg-shell .vgg-status { padding: 10px 16px; border-radius: var(--vgg-radius-md); font-size: 0.8125rem; font-weight: 600; display: flex; align-items: center; gap: 10px; border: 1px solid transparent; }
.vgg-shell .vgg-status-info { background-color: var(--vgg-status-info-bg); color: var(--vgg-status-info-color); border-color: rgba(39, 56, 232, 0.2); }
.vgg-shell .vgg-status-success { background-color: var(--vgg-green-soft); color: var(--vgg-green-dark); border-color: rgba(16, 185, 129, 0.3); }
.vgg-shell .vgg-status-error { background-color: var(--vgg-red-soft); color: var(--vgg-red); border-color: rgba(239, 68, 68, 0.3); }

/* Stage Card */
.vgg-shell .vgg-stage { background-color: var(--vgg-card-bg); border: 1px solid var(--vgg-card-border); border-radius: var(--vgg-radius-xl); box-shadow: var(--vgg-card-shadow); padding: clamp(20px, 4vw, 32px); display: flex; flex-direction: column; gap: 20px; }
.vgg-shell .vgg-stage-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--vgg-card-border); }
.vgg-shell .vgg-stage-title { font-size: 1.125rem; font-weight: 800; color: var(--vgg-ink); letter-spacing: -0.02em; }
.vgg-shell .vgg-stage-sub { font-size: 0.75rem; color: var(--vgg-ink-secondary); }
.vgg-shell .vgg-step-badge { font-size: 0.75rem; font-weight: 700; color: var(--vgg-tag-color); background: var(--vgg-tag-bg); padding: 4px 10px; border-radius: var(--vgg-radius-pill); }

/* Game 1: Tetris 8x8 Grid */
.vgg-shell .vgg-tetris-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.vgg-shell .vgg-tetris-board-frame { background: var(--vgg-board-bg); border: 2px solid var(--vgg-board-border); border-radius: var(--vgg-radius-md); padding: 8px; box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.5); width: 100%; max-width: 320px; }
.vgg-shell [data-vgg-board] { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); gap: 4px; aspect-ratio: 1 / 1; width: 100%; }
.vgg-shell .vgg-cell { background-color: var(--vgg-cell-empty); border-radius: 4px; transition: background-color 0.16s, box-shadow 0.16s; }
.vgg-shell .vgg-cell.is-filled { background-color: var(--vgg-cell-filled); box-shadow: inset 0 2px 0 #4454F5, 0 1px 3px rgba(0, 0, 0, 0.3); }
.vgg-shell .vgg-cell.is-active { background-color: var(--vgg-cell-active); box-shadow: inset 0 2px 0 #FFF8B0, 0 0 12px var(--vgg-yellow-glow); z-index: 2; }
.vgg-shell .vgg-cell.is-ghost { background-color: var(--vgg-cell-ghost); border: 1.5px dashed var(--vgg-cell-ghost-border); }
.vgg-shell .vgg-cell.is-target { background-color: var(--vgg-cell-target); border: 1.5px solid var(--vgg-cell-target-border); box-shadow: 0 0 10px rgba(56, 189, 248, 0.3); }

.vgg-shell .vgg-controls-tetris { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; width: 100%; max-width: 380px; align-items: center; }
.vgg-shell .vgg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: inherit; font-size: 0.875rem; font-weight: 700; border-radius: var(--vgg-radius-md); border: 1px solid var(--vgg-card-border); background-color: var(--vgg-card-bg); color: var(--vgg-ink); cursor: pointer; min-height: 44px; padding: 0 14px; transition: all 0.16s; user-select: none; }
.vgg-shell .vgg-btn:hover { border-color: var(--vgg-cobalt-light); transform: translateY(-1px); }
.vgg-shell .vgg-btn:active { transform: translateY(0); }
.vgg-shell .vgg-btn-primary { background-color: var(--vgg-cobalt); border-color: var(--vgg-cobalt); color: #FFFFFF; box-shadow: 0 4px 14px rgba(39, 56, 232, 0.25); }
.vgg-shell .vgg-btn-primary:hover { background-color: var(--vgg-cobalt-light); border-color: var(--vgg-cobalt-light); }
.vgg-shell .vgg-btn-icon { width: 44px; padding: 0; font-size: 1rem; }
.vgg-shell .vgg-hint-calm { font-size: 0.75rem; color: var(--vgg-ink-secondary); text-align: center; }

/* Game 2: Audition Rhythm Verification */
.vgg-shell .vgg-audition-wrap { display: flex; flex-direction: column; gap: 18px; width: 100%; }
.vgg-shell .vgg-audition-topbar { display: flex; align-items: center; justify-content: space-between; }
.vgg-shell .vgg-eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.vgg-shell .vgg-eq-bar { width: 3px; border-radius: 2px; background-color: var(--vgg-cobalt); height: 6px; }
.vgg-shell .vgg-eq-bar:nth-child(1) { height: 8px; }
.vgg-shell .vgg-eq-bar:nth-child(2) { height: 16px; background-color: var(--vgg-yellow-dark); }
.vgg-shell .vgg-eq-bar:nth-child(3) { height: 12px; }
.vgg-shell .vgg-eq-bar:nth-child(4) { height: 18px; background-color: var(--vgg-green); }

.vgg-shell .vgg-btn-sound { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; color: var(--vgg-ink-secondary); border: 1px solid var(--vgg-card-border); background: none; padding: 4px 10px; border-radius: var(--vgg-radius-pill); cursor: pointer; min-height: 32px; }

.vgg-shell [data-vgg-sequence] { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; background: rgba(0, 0, 0, 0.03); border-radius: var(--vgg-radius-lg); border: 1px solid var(--vgg-card-border); }
.vgg-shell[data-theme="night"] [data-vgg-sequence], [data-theme="night"] .vgg-shell [data-vgg-sequence] { background: rgba(255, 255, 255, 0.03); }

.vgg-shell .vgg-arrow { width: 48px; height: 48px; border-radius: var(--vgg-radius-md); background-color: var(--vgg-card-bg); border: 2px solid var(--vgg-card-border); display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; font-weight: 900; color: var(--vgg-ink-tertiary); transition: all 0.18s; user-select: none; }
.vgg-shell .vgg-arrow.is-done { background-color: var(--vgg-arrow-done-bg); border-color: var(--vgg-arrow-done-color); color: var(--vgg-arrow-done-color); }
.vgg-shell .vgg-arrow.is-current { background-color: var(--vgg-yellow-soft); border-color: var(--vgg-yellow-dark); color: #141B2D; box-shadow: 0 0 0 2px var(--vgg-yellow), 0 4px 12px var(--vgg-yellow-glow); transform: scale(1.08); }

/* Beat Timing Track */
.vgg-shell [data-vgg-beat] { width: 100%; height: 38px; background: var(--vgg-track-bg); border: 2px solid var(--vgg-track-border); border-radius: var(--vgg-radius-pill); position: relative; overflow: hidden; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6); }
.vgg-shell .vgg-beat-zone { position: absolute; left: 25%; width: 50%; top: 0; bottom: 0; background: var(--vgg-beat-zone); border-left: 2px dashed var(--vgg-beat-zone-border); border-right: 2px dashed var(--vgg-beat-zone-border); display: flex; align-items: center; justify-content: center; font-size: 0.6875rem; font-weight: 800; text-transform: uppercase; color: #34D399; letter-spacing: 0.08em; pointer-events: none; }
.vgg-shell .vgg-beat-cursor { position: absolute; top: 2px; bottom: 2px; width: 8px; border-radius: 4px; background: var(--vgg-cursor); box-shadow: 0 0 10px #FFFFFF, 0 0 4px var(--vgg-yellow); left: calc(var(--vgg-beat-progress, 0.5) * 100% - 4px); transition: left 0.05s linear; pointer-events: none; }

.vgg-shell .vgg-touch-arrows { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.vgg-shell .vgg-btn-arrow { min-height: 48px; font-size: 1.25rem; }
.vgg-shell .vgg-beat-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.vgg-shell [data-vgg-tap] { min-height: 48px; font-size: 0.9375rem; background-color: var(--vgg-green-dark); border-color: var(--vgg-green-dark); color: #FFFFFF; box-shadow: 0 4px 14px var(--vgg-green-glow); }
.vgg-shell [data-vgg-tap]:hover { background-color: var(--vgg-green); border-color: var(--vgg-green); }

/* Footer & Fallback */
.vgg-shell .vgg-footer { text-align: center; padding: 8px; font-size: 0.8125rem; color: var(--vgg-ink-secondary); }
.vgg-shell .vgg-link-recaptcha { background: none; border: none; color: var(--vgg-link-color); font-size: inherit; font-family: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; }
.vgg-shell .vgg-link-recaptcha:hover { color: var(--vgg-cobalt-dark); }

/* Focus & Reduced Motion */
.vgg-shell :focus-visible { outline: none; box-shadow: var(--vgg-focus-ring); }
@media (prefers-reduced-motion: reduce) {
  .vgg-shell *, .vgg-shell *::before, .vgg-shell *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .vgg-shell { padding: 16px 10px; }
  .vgg-shell .vgg-methods { grid-template-columns: 1fr; }
  .vgg-shell .vgg-controls-tetris { grid-template-columns: 1fr 1fr; }
  .vgg-shell .vgg-controls-tetris .vgg-btn-primary { grid-column: span 2; }
  .vgg-shell .vgg-controls-tetris .vgg-btn-reset { grid-column: span 2; }
  .vgg-shell [data-vgg-sequence] { gap: 8px; }
  .vgg-shell .vgg-arrow { width: 42px; height: 42px; font-size: 1.1rem; }
}

/* Keep the integration controls and feedback readable after demo base rules. */
.vgg-shell .vgg-status-error{color:#B42318;background:#FFF1F0}
.vgg-shell .vgg-status-success{color:#166534;background:#DCFCE7}
.vgg-shell :focus-visible{outline:2px solid var(--vgg-link-color);outline-offset:3px}
@media(max-width:480px){
  .vgg-shell .vgg-controls-tetris{grid-template-columns:44px 44px 1fr 44px;gap:5px}
  .vgg-shell .vgg-controls-tetris .vgg-btn-primary{grid-column:auto}
  .vgg-shell .vgg-controls-tetris .vgg-btn{padding:0 5px;font-size:12px}
  .vgg-shell .vgg-stage{padding:18px 14px}
}
