@charset "UTF-8";
:root {
  --paper: #f7f6f3; --ink: #292826; --muted: #77746e; --line: #dedbd5;
  --accent: #a64236; --accent-dark: #86342b;
  font-family: "Meiryo", "Yu Gothic", system-ui, sans-serif;
  font-size: 14px; font-synthesis: none; color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button { font-weight: 400; }
button:disabled { opacity: .42; cursor: not-allowed; }
button, a, input, select, textarea, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 19px; font-weight: 600; line-height: 1.5; white-space: nowrap; }
h2 { margin-bottom: 0; font-size: 15px; font-weight: 600; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.site-header-inner { max-width: 1200px; min-height: 76px; margin: auto; padding: 15px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.game-name { color: var(--accent); margin-right: 8px; }
.site-nav { display: flex; gap: 6px; flex-shrink: 0; }
.site-nav button { border: 0; background: none; padding: 10px 12px; font-size: 13px; color: #625f59; }
.site-nav button:hover { color: var(--ink); background: #f5f4f1; }
.site-nav .selected { color: var(--accent); text-decoration: underline; text-underline-offset: 7px; }
main { max-width: 1200px; margin: auto; padding: 24px; }
.workspace { display: grid; grid-template-columns: minmax(290px, 350px) minmax(0, 1fr); gap: 20px; align-items: start; }
.editor-column { display: grid; gap: 14px; min-width: 0; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 4px; min-width: 0; }
.editor-card, .preview-card, .history-card, .notes-card, .password-card { padding: 22px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.small-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.reward-summary strong { overflow-wrap: anywhere; }
.mode-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.mode-tab { border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: none; flex: 1; padding: 0 3px 12px; font-size: 13px; }
.mode-tab.active { border-bottom-color: var(--accent); color: var(--ink); }
.mode-tab:hover { color: var(--ink); }
.field { min-width: 0; }
.field label, .reward-picker label { display: block; margin-bottom: 8px; font-size: 13px; }
.field input, .field select, .field textarea, .reward-picker input, .reward-picker select, .ecc-control select, .usage-heading select { width: 100%; border: 1px solid #ccc8c0; border-radius: 3px; background: #fff; color: var(--ink); min-height: 40px; padding: 9px 10px; }
.field input:focus, .field select:focus, .field textarea:focus, .reward-picker input:focus, .reward-picker select:focus, .ecc-control select:focus { border-color: var(--accent); }
.field input:disabled { background: var(--paper); color: var(--muted); }
.field-help { margin: 8px 0 0; font-size: 12px; line-height: 1.8; color: var(--muted); overflow-wrap: anywhere; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.reward-picker { margin-top: 20px; }
.reward-picker select { margin-top: 10px; }
.special-picker { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 0; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.special-picker strong { font-size: 13px; font-weight: 600; }
.special-picker p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.special-picker .button { min-height: 34px; padding: 6px 13px; flex-shrink: 0; }
.advanced-settings { margin-top: 18px; }
.advanced-settings > summary { padding: 4px 0; font-size: 13px; color: #625f59; }
.advanced-content { margin-top: 14px; }
.advanced-content > .field-help { margin-bottom: 18px; }
.version-field { margin-top: 16px; }
.field-divider { height: 1px; background: var(--line); margin: 20px 0; }
.fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
.field-wide { grid-column: 1 / -1; }
.serial-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.serial-controls button { border: 1px solid var(--line); background: var(--paper); border-radius: 3px; padding: 5px 8px; font-size: 12px; color: #625f59; }
.serial-controls button:hover { background: #edeae4; }
.template-note { margin-top: 18px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.editor-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--line); }
.ecc-control label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ecc-control select { width: 100px; min-height: 38px; padding: 8px; font-size: 13px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; padding: 9px 14px; border: 1px solid #ccc8c0; border-radius: 3px; font-size: 13px; line-height: 1.5; }
.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); }
.secondary { background: #fff; color: var(--ink); }
.secondary:hover:not(:disabled) { background: #f2f0eb; border-color: #a6a198; }
.editor-controls > .button { min-width: 130px; }
.text-button { border: 0; background: none; color: var(--accent); padding: 6px 0; min-height: 32px; font-size: 12px; line-height: 1.5; }
.text-button:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; }
.compact { margin-top: 14px; }
.mono { font-family: "Cascadia Code", "Consolas", monospace; }
.hex-input { min-height: 220px !important; resize: vertical; font-size: 13px; line-height: 1.8; }
.payload-card > summary { font-size: 13px; color: #625f59; padding: 16px 20px; }
.payload-content { padding: 0 20px 16px; }
.payload-stats { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.payload-stats strong { font-size: 12px; font-weight: 400; color: var(--muted); }
#hex-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; background: var(--paper); padding: 12px; border: 1px solid var(--line); margin: 0 0 14px; font-size: 12px; line-height: 1.9; }
.data-details { border-top: 1px solid var(--line); padding-top: 12px; }
.data-details summary { font-size: 12px; color: var(--muted); }
#result-details { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; font-size: 12px; line-height: 1.8; padding-top: 12px; }
.notes-card, .history-card { margin-top: 20px; scroll-margin-top: 20px; }
.notes-card > p, #catalog-notes { font-size: 13px; line-height: 1.9; }
#catalog-notes ul { padding-left: 20px; }
#catalog-notes li { margin: 8px 0; }
.notes-footnote { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.password-intro { font-size: 13px; line-height: 1.9; color: #625f59; }
.password-filters { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(160px, 1fr) minmax(160px, 1fr); gap: 16px; margin: 24px 0; }
.password-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.password-table th { text-align: left; font-weight: 400; color: var(--muted); padding: 0 12px 12px 0; }
.password-table td { border-top: 1px solid var(--line); padding: 12px 12px 12px 0; line-height: 1.8; overflow-wrap: anywhere; }
.password-table .password-value { width: 48%; font-size: 15px; font-weight: 600; user-select: all; }
.password-table .password-action { width: 64px; padding-right: 0; text-align: right; }
.password-empty { text-align: center; font-size: 13px; color: var(--muted); padding: 32px 0; }
.password-about { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; font-size: 12px; color: var(--muted); line-height: 1.9; }
.password-about p { margin: 12px 0 0; }
.password-alias-option { margin-top: 18px; font-size: 13px; }
.password-alias-option label { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.password-alias-option input { accent-color: var(--accent); }
.password-alias-option p { font-size: 12px; line-height: 1.8; color: var(--muted); margin: 8px 0 0; }
.password-kind { display: inline-block; font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 10px; white-space: nowrap; }
#version-select { max-width: 100%; }
html[data-game="yw3"] .format-field { margin-top: 20px; }
.page-footer { display: flex; justify-content: space-between; gap: 14px; padding: 20px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.game-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; }
.game-nav a { color: var(--muted); text-underline-offset: 3px; }
.game-nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.status-message { position: fixed; z-index: 30; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); border: 1px solid #3c3933; background: #3c3933; color: #fff; border-radius: 4px; padding: 12px 18px; font-size: 13px; line-height: 1.8; }
.status-message.error { background: #8b3b32; border-color: #8b3b32; }
dialog { width: min(500px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 1px solid #bcb7ae; border-radius: 4px; padding: 24px; color: var(--ink); background: #fff; }
dialog::backdrop { background: #25221d88; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 17px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 3px; color: #625f59; background: #fff; font-size: 24px; line-height: 1; flex-shrink: 0; }
.icon-button:hover { background: var(--paper); }
.dialog-intro { margin: 20px 0; font-size: 13px; line-height: 1.9; color: var(--muted); }
.drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px; padding: 24px; border: 1px dashed #b5aea3; background: var(--paper); cursor: pointer; text-align: center; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: #f5eeeb; }
.drop-zone strong { font-size: 15px; font-weight: 600; }
.drop-zone span { color: var(--muted); font-size: 12px; }
.drop-zone small { color: var(--muted); font-size: 11px; margin-top: 10px; }
.import-privacy { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.import-error, .field-error { font-size: 13px; line-height: 1.8; color: #9a3c2f; background: #fff2ee; padding: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 800px) {
  .site-header-inner { flex-wrap: wrap; gap: 10px; padding: 14px 20px 8px; }
  .site-nav { margin-left: -10px; }
  main { padding: 20px; }
  .workspace { grid-template-columns: minmax(265px, .85fr) minmax(0, 1fr); gap: 16px; }
  .editor-card, .preview-card { padding: 18px; }
}
@media (max-width: 640px) {
  .site-header-inner { padding: 15px 16px 6px; }
  h1 { font-size: 17px; }
  .game-name { margin-right: 5px; }
  .site-nav { width: calc(100% + 10px); justify-content: space-between; gap: 0; }
  .site-nav button { padding: 10px 6px; font-size: 11px; }
  main { padding: 16px; }
  .workspace { display: flex; flex-direction: column; gap: 16px; }
  .editor-column, .preview-card { width: 100%; }
  .editor-card, .preview-card, .history-card, .notes-card, .password-card { padding: 20px; }
  .password-filters { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .password-table, .password-table tbody { display: block; }
  .password-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .password-table tr { display: grid; grid-template-columns: minmax(0, 1fr) 52px; border-top: 1px solid var(--line); padding: 12px 0; }
  .password-table td { border: 0; padding: 0; }
  .password-table .password-value { width: auto; padding-right: 8px; }
  .password-table .password-item { grid-column: 1; font-size: 12px; color: var(--muted); margin-top: 3px; }
  .password-table .password-action { grid-column: 2; grid-row: 1 / 3; width: auto; align-self: center; }
  .page-footer { flex-direction: column; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
