/* =========================================
   LOCAL GAME STYLES: Find The Key (Major)
   ========================================= */

   :root {
    --game-purple: #a78bfa;
    --game-purple-shadow: #7c3aed;
    
    --game-pink: #f472b6;
    --game-pink-shadow: #db2777;
  
    --pulseColor: #4da3ff;
    --pulseRGBA: rgba(77, 163, 255, 0.28);
  }
  
  /* --- Layout Panels --- */
  .statusPanel {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
  }
  
  .controlsPanel, .answerPanel, .analysisCard {
    background: var(--bg-surface);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 10px 10px;
    padding-bottom: 14px;
    box-shadow: var(--shadow-soft);
  }
  
  body.light-theme .controlsPanel, 
  body.light-theme .answerPanel, 
  body.light-theme .analysisCard {
    border-color: rgba(0, 0, 0, 0.05);
  }
  
  /* --- Game Titles --- */
  .gameMainTitle {
    text-align: center;
    font-size: 22px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
    padding: 0 12px;
  }
  
  .modalGameTitle {
    text-align: center;
    font-size: 22px;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    line-height: 20px;
    color: var(--text-main);
  }
  
  .modalGameSubtitle {
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
  }
  
  /* --- Status Area --- */
  .statusRow { display: flex; flex-direction: column; align-items: center; gap: 20px; }
  .statusText { text-align: center; width: 100%; background: var(--bg-base); padding: 16px; border-radius: var(--radius-sm); border: 2px solid rgba(255,255,255,0.05); }
  .phaseTitle { font-size: 22px; font-weight: 900; color: var(--text-main); margin-bottom: 6px; }
  .feedbackLine { font-size: 16px; color: var(--text-muted); min-height: 24px; font-weight: 500; }
  .feedbackLine strong { color: #fff; font-weight: 800; background: var(--accent); padding: 2px 6px; border-radius: 6px;}
  
  body.light-theme .statusText { border-color: rgba(0,0,0,0.05); }
  
  /* --- Game Controls Grid --- */
  .actionsGrid {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    width: 100%;
  }
  
  .actionsGrid .icon-btn {
    flex: 0 0 52px; 
    height: 52px;
    padding: 0;
    font-size: 22px;
  }
  
  .actionsGrid .flex-text-btn {
    flex: 1 1 0; 
    padding: 0 4px;
    font-size: 12pt;
    white-space: nowrap;
  }
  
  .mainActionRow { display: flex; gap: 6px; }
  
  /* --- Local Game Buttons --- */
  .btn-purple {
    background: var(--game-purple);
    color: #fff;
    border: 2px solid var(--game-purple-shadow);
    box-shadow: 0 4px 0 var(--game-purple-shadow);
  }
  .btn-pink {
    background: var(--game-pink);
    color: #fff;
    border: 2px solid var(--game-pink-shadow);
    box-shadow: 0 4px 0 var(--game-pink-shadow);
  }
  
  .default-btn {
    background: var(--bg-elevated);
    color: var(--text-main);
    box-shadow: 0 4px 0 #1e293b;
  }
  .default-btn:active:not(:disabled) { box-shadow: 0 0px 0 #1e293b; }
  
  .secondary-btn { 
    background: var(--bg-base); 
    color: var(--text-main); 
    border: 2px solid var(--bg-elevated);
    box-shadow: 0 4px 0 var(--bg-elevated);
    font-size: 14px; 
  }
  .secondary-btn:not(:disabled) { background: var(--bg-elevated); color: #fff; box-shadow: 0 4px 0 var(--bg-elevated); }
  .secondary-btn:active:not(:disabled) { box-shadow: 0 0px 0 var(--bg-elevated); transform: translateY(4px); }
  
  .next-btn { 
    background: var(--bg-base); 
    color: var(--text-main); 
    border: 2px solid var(--bg-elevated);
    box-shadow: 0 4px 0 var(--bg-elevated);
    flex: 1; 
  }
  
  .next-btn:disabled {
    opacity: 0.5;
    background: var(--bg-surface);
    color: var(--text-muted);
    border-color: var(--bg-elevated);
    box-shadow: 0 4px 0 var(--bg-elevated);
    cursor: not-allowed;
  }
  
  .nextReady {
    background: var(--next-orange) !important;
    color: #fff !important;
    border-color: var(--next-shadow) !important;
    box-shadow: 0 4px 0 var(--next-shadow) !important;
    --ringColor: rgba(255, 127, 42, 0.4);
    animation: ringPulse 1.5s ease-in-out infinite;
  }
  .nextReady:active:not(:disabled) { box-shadow: 0 0px 0 var(--next-shadow) !important; transform: translateY(4px); }
  
  @keyframes beginPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
    55%  { box-shadow: 0 0 0 12px var(--pulseRGBA); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
  }
  .pulse { animation: beginPulse 1.25s ease-in-out infinite; }
  
  @keyframes submitPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
    55%  { box-shadow: 0 0 0 12px var(--pulseRGBA); }
    100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
  }
  .submitReady { animation: submitPulse 1.1s ease-in-out infinite; }
  
  /* --- Local Inputs --- */
  input:not([type="checkbox"]):not([type="radio"]), select {
    width: 100%;
    height: 50px; 
    background: var(--bg-base);
    border: 2px solid var(--bg-elevated);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 0 16px;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    outline: none;
    -webkit-appearance: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  }
  input:not([type="checkbox"]):not([type="radio"]):focus, select:focus { border-color: var(--accent); }
  select { cursor: pointer; text-align: left; }
  
  .inlineControl { display: flex; flex-direction: column; gap: 6px; width: 100%; }
  
  /* --- Answer Panel & Keyboard Mounting --- */
  .answerPanel { margin-top: 0px; padding: 6px; }
  .mount { overflow-x: auto; overflow-y: hidden; padding-bottom: 0px; width: 100%; }
  .mount svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
  .modalMount { padding-bottom: 0; }
  
  /* --- Score & Analysis --- */
  .analysis { padding: 0; background: transparent; border: none; box-shadow: none; margin-top: 14px; }
  .scoreCardNarrow { max-width: 100%; }
  .inside-modal { background: transparent; border: none; box-shadow: none; padding: 0; }
  .analysisLabel { font-size: 18px; font-weight: 900; color: var(--text-main); margin-top: 12px; margin-bottom: 4px; text-align: center; }
  .scoreMeta { text-align: center; font-size: 14px; font-weight: 700; color: var(--text-muted); margin-bottom: 12px; }
  .scoreActions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px }
  
  .scoreGrid { display: grid; gap: 8px; }
  .scoreGridVertical { grid-template-columns: 1fr; }
  
  .scoreItem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-base);
    border-radius: var(--radius-sm);
    border: 2px solid var(--bg-elevated);
  }
  .scoreK { font-size: 13px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
  .scoreV { font-size: 20px; font-weight: 900; }
  .text-correct { color: var(--info-teal); }
  .text-incorrect { color: var(--danger); }
  .text-accent { color: var(--accent); }
  
  .settingsGrid { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
  .settingsLabel { font-size: 12px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
  
  .modalSection { margin-top: 10px; }
  .modalSubText { font-size: 12px; font-weight: 800; opacity: .75; margin: 0 0 8px; color: var(--text-muted); }