/* Native HTML inputs keep Korean IME and mobile keyboards reliable above the game canvas. */
#record-open, #record-dialog { font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif; }
#record-open { position: fixed; z-index: 9; top: max(16px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); padding: 11px 19px; border: 1px solid #dfc99c; border-radius: 13px; background: #263829f5; color: #fff3d5; font-size: 15px; font-weight: 750; cursor: pointer; box-shadow: 0 3px 0 #152b20; touch-action: manipulation; }
#record-open[hidden], #record-dialog [hidden] { display: none !important; }
#record-dialog { box-sizing: border-box; width: min(850px, calc(100vw - 32px)); max-width: none; max-height: min(88dvh, 800px); margin: auto; padding: 0; border: 1px solid #91ae79; border-radius: 24px; background: #f7f1df; color: #253d30; box-shadow: 0 25px 100px #071a13a6; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; }
#record-dialog::backdrop { background: #0e231dcc; }
#record-dialog * { box-sizing: border-box; }
#record-dialog button, #record-dialog input { font: inherit; touch-action: manipulation; }
#record-dialog button { cursor: pointer; }
#record-dialog button:disabled { cursor: wait; opacity: .55; }
#record-dialog button:focus-visible, #record-dialog input:focus-visible, #record-open:focus-visible { outline: 3px solid #578046; outline-offset: 3px; }
.record-header { padding: 25px 28px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid #d4dcc6; background: #e9efd9; }
.record-eyebrow { margin: 0 0 6px; color: #577047; font-size: 11px; font-weight: 800; letter-spacing: .15em; }
#record-title { margin: 0; font-size: 27px; letter-spacing: -.06em; }
.record-close { flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid #b1c59b; border-radius: 50%; background: transparent; color: #354d33; font-size: 24px !important; line-height: 1; }
.record-body { padding: 22px 28px 26px; }
.record-intro { margin: 0 0 18px; font-size: 14px; line-height: 1.65; color: #60725d; }
.run-stats, .board-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.run-stat, .board-stat { padding: 15px; background: #fffdf5; border: 1px solid #d8dfc9; border-radius: 14px; min-width: 0; }
.run-stat span, .board-stat span { display: block; margin-bottom: 7px; font-size: 11px; color: #677858; }
.run-stat strong, .board-stat strong { font-size: 22px; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
#record-form label, #name-search label { display: block; font-size: 13px; font-weight: 750; margin: 0 0 8px; }
.record-input-row { display: flex; align-items: stretch; gap: 8px; }
.record-input-row input { width: 100%; min-width: 0; background: #fffef8; border: 1px solid #aabf90; border-radius: 11px; color: #253d30; padding: 12px 14px; font-size: 16px !important; touch-action: auto !important; }
.record-primary { flex: 0 0 auto; border: 0; border-radius: 11px; padding: 12px 20px; color: #fff7e1; background: #365e3e; font-weight: 750 !important; }
.record-note { margin: 10px 0 0; font-size: 12px; line-height: 1.65; color: #718068; }
.record-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; }
.record-secondary { color: #445d3d; background: #e6edd8; border: 1px solid #bccdad; border-radius: 10px; padding: 9px 14px; font-size: 13px !important; font-weight: 650 !important; }
.record-quiet { padding: 10px 4px; border: 0; background: transparent; color: #65745e; font-size: 13px !important; text-decoration: underline; text-underline-offset: 3px; }
#record-message { margin: 14px 0 0; padding: 11px 14px; border-radius: 10px; background: #e3edd4; color: #385b2f; font-size: 13px; line-height: 1.6; }
#record-message:empty { display: none; }
#record-message[data-error="true"] { color: #8c372d; background: #fae7d9; }
.board-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin: 20px 0 12px; }
.record-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.record-tabs button { border: 1px solid #c5d2b7; border-radius: 9px; color: #677a58; background: transparent; padding: 9px 12px; font-size: 12px !important; font-weight: 700 !important; }
.record-tabs button[aria-pressed="true"] { color: #fff6da; border-color: #365e3e; background: #365e3e; }
.board-scroll { overflow-x: auto; border: 1px solid #d4dcc6; border-radius: 13px; background: #fffdf6; }
.board-table { border-collapse: collapse; width: 100%; white-space: nowrap; font-size: 13px; text-align: left; }
.board-table th { padding: 12px 13px; font-size: 11px; color: #7c8c6b; background: #f0f3e7; font-weight: 650; }
.board-table td { padding: 13px; border-top: 1px solid #e3e8d8; font-variant-numeric: tabular-nums; }
.board-table td:first-child { color: #8a9477; width: 43px; }
.board-table tr:first-child td:first-child { color: #9a771d; font-weight: 900; }
.board-table .board-name { font-weight: 750; color: #365239; }
.board-table .board-me { background: #eef5df; }
#board-empty { text-align: center; color: #788766; padding: 28px 16px; font-size: 14px; margin: 0; }
#board-personal { margin: 16px 0 0; padding: 14px 16px; background: #e6eed8; border-radius: 12px; line-height: 1.8; font-size: 13px; }
#board-personal strong { display: block; margin-bottom: 3px; color: #365439; }
#name-search { display: flex; gap: 10px; align-items: center; margin: 18px 0 0; }
#name-search label { flex: 0 0 auto; margin: 0; }
#name-search .record-input-row { flex: 1; }
#name-search input { font-size: 14px !important; padding: 9px 12px; }
@media (max-width: 560px) {
  #record-dialog { width: calc(100vw - 20px); max-height: 94dvh; border-radius: 18px; }
  .record-header { padding: 19px 18px 16px; }
  #record-title { font-size: 23px; }
  .record-body { padding: 17px 18px 22px; }
  .run-stats, .board-stats { gap: 6px; }
  .run-stat, .board-stat { padding: 12px 9px; }
  .run-stat strong, .board-stat strong { font-size: 19px; }
  .record-primary { padding: 10px 13px; }
  .board-table th, .board-table td { padding: 12px 10px; }
  #name-search { display: block; }
  #name-search label { margin-bottom: 8px; }
  #record-open { padding: 9px 14px; font-size: 13px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  #record-dialog { max-height: 94dvh; }
  .record-header { padding: 12px 24px; }
  .record-body { padding-top: 14px; }
  .run-stats { margin-bottom: 12px; }
}
