.match-skip { position: absolute; left: 20px; top: -100px; z-index: 30; background: white; padding: 14px; }
.match-skip:focus { top: 10px; }
.match-hero { padding: 52px 0 32px; }
.match-hero h1 { margin-top: 10px; }
.match-hero p { max-width: 720px; }
.match-section { padding: 0 0 72px; }
.match-game { max-width: 850px; margin: auto; padding: 32px; border: 1px solid var(--green-line); border-radius: var(--radius); background: var(--white); box-shadow: 0 12px 40px #22222206; }
.match-toolbar, .match-stats { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.match-toolbar label { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 8px; }
.match-toolbar select { font: inherit; max-width: 100%; padding: 12px; border: 1px solid #929b95; border-radius: 10px; background: white; color: var(--ink); }
.match-toolbar button, .match-complete button { cursor: pointer; }
.match-stats { margin-top: 28px; font-size: .85rem; }
.match-stats strong { font-size: 1.15rem; }
.match-game progress { display: block; width: 100%; height: 10px; margin: 14px 0 28px; accent-color: var(--green); border: 0; border-radius: 10px; overflow: hidden; background: var(--soft); }
.match-game progress::-webkit-progress-bar { background: var(--soft); }
.match-game progress::-webkit-progress-value { background: var(--green); }
.match-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.match-board h2 { font-size: 1.3rem; margin-bottom: 18px; }
.match-board h2 small { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; letter-spacing: 0; margin-top: 6px; }
.match-words { display: grid; gap: 12px; }
.word { min-height: 62px; width: 100%; padding: 12px; border: 2px solid var(--line); border-radius: 12px; font-weight: 700; background: white; color: var(--ink); cursor: pointer; overflow-wrap: anywhere; }
.word:hover:not(:disabled) { border-color: var(--green); background: #f0fbf5; }
.word[aria-pressed="true"] { border-color: var(--ink); background: #e4f6ec; box-shadow: 0 0 0 1px var(--ink); }
.word.matched { border-color: var(--green-line); background: #e4f6ec; color: #14633b; cursor: default; }
.word.matched::after { content: ' ✓'; }
.match-feedback { min-height: 3.7em; margin: 22px 0 0; color: var(--ink); font-weight: 600; font-size: .9rem; }
.match-complete { border-top: 1px solid var(--green-line); padding-top: 24px; text-align: center; }
.match-complete h2 { color: #14633b; }
[hidden] { display: none !important; }
@media (max-width: 560px) { .match-game { padding: 20px 14px; } .match-board { gap: 14px; } .word { font-size: .88rem; } .match-hero { padding-top: 32px; } .match-stats { gap: 8px; font-size: .75rem; } }
/* Equal row heights keep each English word beside its Welsh partner. */
.match-words { grid-auto-rows: 84px; }
.word { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 0; font: inherit; font-weight: 700; }
#welsh-words .word { cursor: default; }
#english-words .word:not(:disabled) { cursor: grab; touch-action: none; user-select: none; }
.word small { font-size: .65rem; font-weight: 600; letter-spacing: 0; }
.word.matched::after { content: none; }
.word.incorrect { border-color: #bc392d; background: #fff4f2; }
.word.incorrect small { color: #9f3026; }
.word.dragging { position: relative; z-index: 5; cursor: grabbing !important; box-shadow: 0 8px 20px #22222230; opacity: .92; pointer-events: auto; }
.word.drop-target { outline: 2px dashed var(--ink); outline-offset: 3px; }
.match-check { margin-top: 24px; text-align: center; }
.match-check .btn { min-width: 160px; cursor: pointer; }
.match-check .btn:disabled { opacity: .55; cursor: default; transform: none; }
@media (max-width: 560px) { .word { font-size: .85rem; padding: 8px; } .word small { font-size: .6rem; } }
#welsh-words .word:not(:disabled) { cursor: grab; touch-action: none; user-select: none; }
.match-next-topic { margin: 20px auto; }
.match-next-topic label { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 8px; }
.match-next-topic select { font: inherit; max-width: 100%; padding: 12px; border: 1px solid #929b95; border-radius: 10px; background: white; color: var(--ink); }
.match-course { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.match-course p { max-width: 540px; margin: 0 auto 18px; }
.match-course { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px; text-align: left; }
.match-course > * { min-width: 0; }
.match-course img { display: block; width: 100%; height: auto; object-fit: contain; border-radius: 12px; }
@media (max-width: 560px) { .match-course { grid-template-columns: 1fr; text-align: center; } .match-course img { max-width: 320px; margin-inline: auto; } }
/* Compact game layout keeps the board and Check button together. */
.match-hero { padding: 22px 0 14px; }
.match-hero .mini-tag { margin-bottom: 4px; }
.match-hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 8px 0; }
.match-hero .lead { font-size: 1rem; margin: 6px 0; }
.match-hero #instructions { font-size: .8rem; line-height: 1.5; margin: 6px 0; max-width: 850px; }
.match-section { padding-bottom: 32px; }
.match-game { max-width: 760px; padding: 18px 24px; }
.match-toolbar label { margin-bottom: 4px; font-size: .75rem; }
.match-toolbar select { padding: 8px 10px; font-size: .85rem; }
.match-toolbar .btn { min-height: 40px; padding: 8px 16px; }
.match-stats { margin-top: 12px; font-size: .78rem; }
.match-stats strong { font-size: 1rem; }
.match-game progress { height: 7px; margin: 8px 0 12px; }
.match-board { gap: 20px; }
.match-board h2 { font-size: 1.1rem; margin-bottom: 10px; }
.match-words { grid-auto-rows: 52px; gap: 8px; }
.word { padding: 5px 10px; gap: 3px; font-size: .88rem; border-radius: 10px; }
.word small:empty { display: none; }
.match-check { margin-top: 12px; }
.match-check .btn { min-height: 40px; padding: 8px 20px; }
.match-feedback { min-height: 1.5em; margin-top: 10px; font-size: .78rem; line-height: 1.5; }
@media (max-width: 560px) {
  .match-hero { padding-top: 16px; }
  .match-game { padding: 14px; }
  .match-board { gap: 12px; }
  .match-words { grid-auto-rows: 54px; }
  .word { font-size: .8rem; padding: 4px; }
  .match-toolbar { gap: 10px; }
  .match-toolbar > div { min-width: 0; flex: 1; }
  .match-toolbar select { width: 100%; }
}
