/* Gold box, private notes, and the artwork editor. */
#box-panel button {
  border: 1px solid #9d875b; border-radius: 2px; background: linear-gradient(#454d3c, #252e2b);
  color: var(--gold); padding: 10px 16px; font: 21px/1.2 var(--rune);
  min-height: 44px; cursor: pointer; box-shadow: inset 0 0 0 2px #111b1955;
}
#box-panel button:hover { border-color: #f5d682; filter: brightness(1.15); }
#box-panel :is(button,select,textarea):focus-visible { outline: 2px solid #ffe398; outline-offset: 3px; }
#roll-flight { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.flying-roll {
  position: absolute; padding: 6px 25px 6px 14px; color: #422c16; white-space: nowrap;
  font: 30px/1 var(--rune); border: 1px solid #856038;
  background: radial-gradient(ellipse 7px 55% at calc(100% - 7px) 50%,#58391f 20%,#b2804a 34%,#76502b 45%,#d8b77a 62%,transparent 69%),
    linear-gradient(#9b7240, #f5dfab 31%, #c49a62 89%, #714c29);
  box-shadow: 0 4px 9px #1b130bbf, inset 3px 0 3px #70462065;
}
#box-message:not(.box-warning) { position: fixed; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
#box-message.box-warning { position: fixed; bottom: max(80px, 12vh); z-index: 9; left: 50%; transform: translateX(-50%); width: min(450px, 90vw); padding: 10px; background: #30291f; color: var(--gold); text-align: center; }
#box-panel { color: #eee1bb; border: 2px solid #9e8250; border-radius: 3px; background: #182323; max-height: 91svh; box-shadow: inset 0 0 0 3px #0c1518, 0 30px 120px #000b; padding: 38px; overscroll-behavior: contain; }
#box-panel::backdrop { background: #01070cbb; backdrop-filter: blur(7px); }
#box-panel { width: min(850px, 92vw); }
#box-panel .dialog-close { position: absolute; right: 14px; top: 10px; min-height: 44px; width: 44px; padding: 0; border: none; box-shadow: none; font: 32px var(--mono); color: var(--gold); background: none; cursor: pointer; }
#box-panel h2 { font: clamp(32px, 4vw, 48px)/1.1 var(--rune); margin: 7px 35px 16px 0; color: var(--gold); }
.dialog-eyebrow { font: 18px var(--mono); color: #b6b9a0; margin: 0; }
#box-panel p { font: 17px/1.6 var(--serif); color: #cdcbb6; }
.token-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 22px; }
#box-panel .word-token { display: inline-flex; gap: 8px; align-items: center; max-width: 100%; overflow-wrap: anywhere; position: relative; font: 25px var(--rune); min-height: 53px; padding: 10px 15px; background: linear-gradient(135deg,#454b39,#293528); border: 2px solid #6e7650; }
#box-panel .word-token.is-kept { background: #51462f; border-color: #c9aa66; }
#box-panel .word-token.is-selected { outline: 2px solid #e7cf8c; outline-offset: 2px; }
.kept-roll { flex: 0 0 24px; height: 13px; border-radius: 2px 5px 5px 2px;
  background: radial-gradient(ellipse 3px 6px at 89% 50%, #ae8450 20%, #563c23 45%, transparent 60%),
    linear-gradient(#7a572d, #f4dfab 34%, #b78949 81%, #6a4526); box-shadow: 0 2px 3px #0d1217; }
.keepsake-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: 30px; margin-top: 24px; }
#box-panel h3 { font: 27px/1.15 var(--rune); color: var(--gold); margin: 0 0 15px; }
.word-inspection { min-width: 0; overflow-wrap: anywhere; padding: 25px; background: #e0cfaa; color: #3d3527; border: 3px double #9a835c; }
#box-panel .word-inspection h3 { font-size: 40px; color: #4b371d; }
#box-panel .word-inspection p { color: #433b2b; }
#box-panel .word-inspection .word-theme { font: 18px var(--mono); margin: 0 0 10px; }
.letter-source { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-bottom: 20px; }
.letter-source .source-word { display: inline-flex; white-space: nowrap; max-width: 100%; }
.letter-source .source-word > span { min-width: 0; font: 20px var(--rune); color: #96876c; padding: 3px; }
.letter-source .source-word > .used { color: #392b13; background: #c2a86e; }
.word-inspection label { display: block; font: 17px/1.4 var(--serif); margin: 23px 0 9px; }
#word-note { font: 16px/1.5 var(--serif); color: #342c20; background: #f4ecd9; border: 1px solid #9c8964; width: 100%; resize: vertical; padding: 10px; }
#note-state { font-size: 12px; line-height: 1.4; display: block; margin-top: 7px; }
.keepsake-order { margin-top: 30px; border-top: 1px solid #596046; padding-top: 24px; }
.keepsake-order ol { list-style-position: inside; padding: 0; }
.keepsake-order li { display: flex; gap: 8px; align-items: center; border-bottom: 1px solid #485139; padding: 7px 0; }
.keepsake-order li span { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 26px var(--rune); }
#box-panel button:disabled { opacity: .35; cursor: default; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.keepsake-card { width: min(100%, 450px); display: block; margin: 0 auto; box-shadow: 0 15px 45px #020a0da8; }
#box-panel[data-view=card] { width: min(1150px,94vw); }
.art-studio { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 34px; align-items: start; margin-top: 26px; }
.art-preview { padding: 18px; background: #0c171a; }
#box-panel #art-status { font-size: 13px; text-align: center; margin-bottom: 0; }
.art-controls fieldset { padding: 0; margin: 0 0 24px; border: 0; min-width: 0; }
.art-controls legend, .art-controls > label { display: block; font: 18px/1.4 var(--serif); margin-bottom: 10px; color: #ddd9bd; }
.art-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
#box-panel .art-options button { text-align: left; font-size: 23px; }
.art-options button small { display: block; font: 13px/1.4 var(--serif); color: #c1c5ad; margin-top: 7px; }
#box-panel .art-options [aria-pressed=true] { border-color: #f2d99b; background: #4d5038; box-shadow: inset 0 0 0 1px #f2d99b; }
#art-word, #share-caption { width: 100%; background: #101d21; border: 1px solid #778264; color: #f1e5c3; padding: 10px 12px; font: 17px/1.5 var(--serif); margin-bottom: 20px; }
#art-word { font: 25px var(--rune); min-height: 48px; }
#share-caption { resize: vertical; }
#box-panel .art-privacy { font-size: 13px; margin: 14px 0 26px; }
#box-panel .art-controls [data-download] { width: 100%; padding: 13px; font-size: 26px; background: #695e3e; border-color: #ccb273; }
@media(max-width:760px) { .art-studio { grid-template-columns: 1fr; gap: 24px; } .art-preview { padding: 12px; } }

.art-export { display: grid; gap: 8px; }
#box-panel .art-controls [data-share] { width: 100%; }
@media(max-width:600px) {
  #box-panel { padding: 29px 20px 24px; width: 94vw; max-height: 93svh; }
  #box-panel h2 { font-size: 33px; }
  .dialog-eyebrow { font-size: 15px; max-width: 88%; }
  .keepsake-layout { grid-template-columns: minmax(0,1fr); gap: 18px; }
  .word-inspection { padding: 18px; }
  #box-panel .word-token { font-size: 22px; padding: 8px 12px; }
  .panel-actions { gap: 8px; }
  #box-panel .panel-actions button { font-size: 18px; padding: 9px 10px; }
}
