/* =========================================
   LOCAL GAME STYLES: Sus2 Or Sus4
   Builds on top of ../../shared/global.css
   ========================================= */

   :root {
    /* Game-local replay button colour */
    --game-pink:        #f472b6;
    --game-pink-shadow: #db2777;
  
    /* Per-answer-button accent colours (Emotional association tuning) */
    --answer-sus2:         #0ea5e9; /* Open / airy sky blue */
    --answer-sus2-shadow:  #0369a1;
    --answer-sus4:         #a855f7; /* Tense / unresolved purple */
    --answer-sus4-shadow:  #7e22ce;
    
    --chordTone: #0cbc67;
  }
  
  /* ─── Game title ─── */
  .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;
  }
  
  .modalGameSubtitle {
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  
  /* ─── Layout panels ─── */
  .statusPanel {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
  }
  
  .controlsPanel,
  .analysisCard {
    background: var(--bg-surface);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 20px 16px;
    box-shadow: var(--shadow-soft);
  }
  
  body.light-theme .controlsPanel,
  body.light-theme .analysisCard {
    border-color: rgba(0, 0, 0, 0.06);
  }
  
  .answerPanel {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  
  /* ─── Status area ─── */
  .statusRow { display: flex; flex-direction: column; align-items: center; }
  
  .statusText {
    text-align: center;
    width: 100%;
    background: var(--bg-base);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(255, 255, 255, 0.05);
  }
  
  body.light-theme .statusText { border-color: rgba(0, 0, 0, 0.05); }
  
  .phaseTitle { font-size: 22px; font-weight: 900; color: var(--text-main); margin-bottom: 6px; }
  
  .feedbackLine {
    font-size: 15px; color: var(--text-muted); min-height: 22px; font-weight: 500; line-height: 1.5;
  }
  
  .feedbackLine strong {
    color: #fff; font-weight: 800; background: var(--accent); padding: 2px 6px; border-radius: 6px;
  }
  body.light-theme .feedbackLine strong { color: #fff; }
  
  /* ─── Controls grid ─── */
  .actionsGrid { display: flex; gap: 8px; 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: 14px; white-space: nowrap; }
  
  .mainActionRow { display: flex; gap: 12px; }
  .mainActionRow #beginBtn { flex: 2; }
  .mainActionRow #replayBtn { flex: 1.2; }
  .mainActionRow #nextBtn  { flex: 1; }
  
  .btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none !important; }
  
  .btn-pink { background: var(--game-pink); color: #fff; border: 2px solid var(--game-pink-shadow); box-shadow: 0 4px 0 var(--game-pink-shadow); }
  #replayBtn.pulse { --ringColor: rgba(244, 114, 182, 0.4); }
  
  .default-btn { background: var(--bg-elevated); color: var(--text-main); border: 2px solid transparent; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25); }
  body.light-theme .default-btn { box-shadow: 0 4px 0 #cbd5e1; }
  
  .secondary-btn { background: var(--bg-elevated); color: var(--text-main); border: 2px solid var(--bg-elevated); box-shadow: 0 4px 0 var(--bg-elevated); font-size: 15px; }
  .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); }
  .next-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }
  
  .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); }
  
  /* ─── Answer buttons ─── */
  .momAnswerGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px;}
  .refGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  
  .answerBtn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 84px; gap: 5px; border-radius: var(--radius-sm); font-family: var(--font-main);
    background: var(--bg-surface); color: var(--text-main); border: 2px solid var(--bg-elevated);
    box-shadow: 0 4px 0 var(--bg-elevated); transition: transform 0.1s, box-shadow 0.1s, background-color 0.12s;
    cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  }
  .answerBtn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0px 0 var(--bg-elevated); }
  .answerLabel { font-size: 18px; font-weight: 900; }
  
  .refBtn {
    height: 52px; background: var(--bg-elevated); color: var(--text-main); border: 2px solid transparent;
    box-shadow: 0 4px 0 rgba(0,0,0,0.2); font-size: 13px; border-radius: var(--radius-sm);
  }
  body.light-theme .refBtn { box-shadow: 0 4px 0 #cbd5e1; }
  
  /* Clean fitting for the top row items */
  .top-ref-btn {
    flex: 1 1 0;
    padding: 0 4px;
    font-size: clamp(16px, 2.8vw, 13px);
    white-space: nowrap;
    background-color: #f472b6; border: 2px solid #b15296;
    box-shadow: 0 4px 0 #b15296; transition: transform 0.1s, box-shadow 0.1s, background-color 0.12s;
  }
  
  #sus2Btn:not(:disabled):not(.answer-correct):not(.answer-incorrect):not(.answer-reveal) {
    background: var(--answer-sus2); color: #fff; border-color: var(--answer-sus2-shadow); box-shadow: 0 4px 0 var(--answer-sus2-shadow);
  }
  
  #sus4Btn:not(:disabled):not(.answer-correct):not(.answer-incorrect):not(.answer-reveal) {
    background: var(--answer-sus4); color: #fff; border-color: var(--answer-sus4-shadow); box-shadow: 0 4px 0 var(--answer-sus4-shadow);
  }
  
  .answerBtn:disabled {
    opacity: 0.38; cursor: default; transform: none !important;
    background: var(--bg-surface) !important; color: var(--text-muted) !important;
    border-color: var(--bg-elevated) !important; box-shadow: 0 4px 0 var(--bg-elevated) !important;
  }
  
  .answerBtn.answer-correct, .answerBtn.answer-correct:disabled {
    background: var(--info-teal) !important; border-color: var(--info-shadow) !important;
    box-shadow: 0 4px 0 var(--info-shadow) !important; color: #fff !important; opacity: 1 !important; cursor: default;
  }
  
  .answerBtn.answer-reveal, .answerBtn.answer-reveal:disabled {
    background: var(--info-teal) !important; border-color: var(--info-shadow) !important;
    box-shadow: 0 4px 0 var(--info-shadow) !important; color: #fff !important; opacity: 1 !important; cursor: default;
  }
  
  .answerBtn.answer-incorrect, .answerBtn.answer-incorrect:disabled {
    background: var(--danger) !important; border-color: var(--danger-shadow) !important;
    box-shadow: 0 4px 0 var(--danger-shadow) !important; color: #fff !important; cursor: default;
    animation: incorrectFade 0.9s ease forwards;
  }
  @keyframes incorrectFade { from { opacity: 1; } to { opacity: 0.4; } }
  
  /* ─── Mini keyboard section ─── */
  .keyboardSection { display: flex; flex-direction: column; align-items: center; gap: 8px; }
  
  .miniLegend { display: flex; gap: 18px; align-items: center; font-size: 12px; font-weight: 800; color: var(--text-muted); user-select: none; }
  .legendDot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; margin-right: 5px; border: 1px solid rgba(0, 0, 0, 0.15); }
  .legendTone { background: var(--chordTone); }
  
  .mount { overflow: hidden; width: 100%; }
  .mount svg { display: block; margin: 0 auto; width: 100%; height: auto; }
  
  /* Keyboard + compare buttons share one wrapper */
  .kbBox {
    width: 100%; background: var(--bg-base); border-radius: var(--radius-md);
    border: 2px solid var(--bg-elevated); padding: 12px; box-sizing: border-box;
    display: flex; flex-direction: column; gap: 12px;
  }
  .miniMount { min-height: 101px; display: flex; align-items: center; justify-content: center; width: 100%; }
  .compareSection { width: 100%; }
  .cmpGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cmpBtn { height: auto; min-height: 48px; padding: 6px 8px; white-space: normal; line-height: 1.15; font-size: 13px; }
  .cmpBtn.cmp-answer {
    background: var(--info-teal); border-color: var(--info-shadow); box-shadow: 0 4px 0 var(--info-shadow); color: #fff;
  }
  .cmpBtn.cmp-active { outline: 3px solid #3b82f6; outline-offset: 1px; }
  .cmpBtn.cmp-answer.cmp-active { outline-color: #fff; }

  /* Low-root toggle switch (plain text + switch) */
  .switchRow {
    display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
    margin: 12px 0 8px; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  }
  .switchText { font-size: inherit; font-weight: inherit; color: inherit; text-align: center; }
  .switchInput { position: absolute; opacity: 0; width: 0; height: 0; }
  .switchTrack {
    position: relative; flex: 0 0 auto; width: 42px; height: 24px; border-radius: 999px;
    background: var(--bg-elevated); border: 2px solid var(--bg-elevated); transition: background-color 0.15s;
  }
  .switchTrack::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--text-muted); transition: transform 0.15s, background-color 0.15s;
  }
  .switchInput:checked + .switchTrack { background: var(--info-teal); border-color: var(--info-shadow); }
  .switchInput:checked + .switchTrack::after { transform: translateX(18px); background: #fff; }
  .switchInput:focus-visible + .switchTrack { outline: 2px solid var(--accent); outline-offset: 2px; }
  
  /* ─── Score & analysis ─── */
  .analysis      { padding: 0; background: transparent; border: none; box-shadow: none; }
  .analysisGrid  { display: grid; gap: 10px; }
  .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-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); }
  
  /* ─── Inputs & selects ─── */
  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:focus, select:focus { border-color: var(--accent); }
  select { cursor: pointer; }
  
  .inlineControl { display: flex; flex-direction: column; gap: 6px; width: 100%; }
  .compactSelect { cursor: pointer; }
  .settingsGrid { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
  .settingsLabel { font-size: 12px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
  .settingsHint { font-size: 13px; font-weight: 600; color: var(--accent); margin-top: 2px; margin-bottom: 4px; }

  /* Help-modal diagrams */
  .helpFig { margin: 4px 0 14px; text-align: center; }
  .helpFig .helpKb svg { display: block; margin: 0 auto; width: 100%; height: auto; }
  .helpFig figcaption { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
  .helpFigRow { display: flex; gap: 12px; flex-wrap: wrap; }
  .helpFigRow .helpFig { flex: 1 1 150px; min-width: 0; }
  .helpFigWide .helpKb svg { max-width: 100%; }
  .introInfoBtn { margin-top: 8px; width: 100%; }
  .settingsNote { font-size: 13px; }
  .helpSide { display: flex; align-items: center; gap: 10px; }
  .helpSide .helpKb { flex: 1 1 auto; min-width: 0; }
  .helpPlayBtn {
    flex: 0 0 auto; height: 36px; padding: 0 12px; font-size: 13px; font-weight: 800;
    background: var(--bg-elevated); color: var(--text-main); border: 2px solid var(--bg-elevated);
    box-shadow: 0 3px 0 rgba(0,0,0,0.2); border-radius: var(--radius-sm); cursor: pointer;
  }
  .helpPlayBtn:active { transform: translateY(3px); box-shadow: 0 0 0 transparent; }
  .helpFig > .helpPlayBtn { display: flex; align-items: center; justify-content: center; margin: 8px auto 0; }
