/* Controls for the camp journal. Material tiles have no baked-in lettering. */
:root {
  --bookcloth: url('/theme/controls-linen.webp');
  --writing-stock: url('/theme/controls-ivory.webp');
  --brass: url('/theme/controls-brass.webp');
  --tool-leather: url('/theme/controls-leather.webp');
  --key-edge: inset 0 0 0 1px #efda9d65, inset 0 2px 2px #fff3, 0 2px 0 #172b27, 0 3px 5px #07151136;
}
body button:not(.listbutton):not([data-tab]) {
  --surface: var(--bookcloth);
  --wash: linear-gradient(155deg,#285b4b80,#122f2bd9);
  background: var(--wash), var(--surface) center / 155px;
  border: 1px solid #9b895d;
  border-radius: 4px 8px 4px 8px;
  color: #fff2cf;
  box-shadow: var(--key-edge);
  font-weight: 600;
  text-shadow: 0 1px 1px #0007;
}
body button.secondary:not(.listbutton):not([data-tab]), #maptools button:not(.listbutton) {
  --surface: var(--tool-leather);
  --wash: linear-gradient(165deg,#53726677,#132d2bd0);
  background: var(--wash), var(--surface) center / 160px;
  color: #fff1ce;
  border-color: #96865c;
}
body .session-page-actions button.secondary, body dialog button[type='submit'], body #login button, body #share {
  background: linear-gradient(145deg,#fff1bf9e,#b7863e33), var(--brass) center / 170px;
  border-color: #897346;
  color: #2c291d;
  text-shadow: 0 1px #ffe9a775;
}
body button:not(.listbutton):not([data-tab]):hover:enabled {
  filter: brightness(1.13);
  border-color: #e0c990;
}
body button:not(.listbutton):not([data-tab]):active:enabled,
body #maptools button.active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px #15231dc2, inset 0 0 0 1px #c7ad78;
}
body button:disabled {filter:saturate(.35);opacity:.56;cursor:not-allowed}
body nav button[data-tab].active, body aside .listbutton.selected {
  background: linear-gradient(90deg,#365848cf,#21392bab), var(--bookcloth) center/165px !important;
}
body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]),
body textarea, body select, body header select, body aside input {
  background-color:#f4e7c9;
  background-image:linear-gradient(100deg,#fffbed80,#f9f1d782),var(--writing-stock);
  background-size:auto,240px;
  color:#2b342d;caret-color:#22634d;
  border:1px solid #9c8860;border-bottom-color:#66593c;border-radius:4px;
  box-shadow:inset 0 2px 4px #68562b30,inset 0 0 0 2px #fff9ec65;
  padding:8px 11px;font:inherit;
}
body textarea {line-height:1.65}
body :is(input,textarea)::placeholder {color:#64685b;opacity:1}
body select option {color:#27372e;background:#f7ecd3}
body :is(input,textarea,select,button):focus-visible {
  outline:2px solid #efa94e;outline-offset:3px;
}
body :is(input,textarea,select):disabled {opacity:.65;cursor:not-allowed}
@media (forced-colors:active) {
  body button,body input,body textarea,body select {background-image:none!important;box-shadow:none}
}

/* Short forms fit an index card; the longer character forms use the full journal. */
dialog:has(#team-name-form) {width:min(430px,calc(100vw - 32px));padding:24px}
#team-name-form label {display:grid;gap:6px;font-size:13px;font-weight:600;color:#3a5447}
#team-name-form input {width:100%;box-sizing:border-box}
#team-name-form button, #modal form button[type=submit], #login button {
  background:linear-gradient(145deg,#ffebac85,#a578372a),var(--brass) center / 158px;
  border-color:#816d43;color:#30281a;text-shadow:0 1px #ffe2a89c;
}
#team-name-form {display:grid;gap:12px;justify-items:stretch}
#team-name-form button {justify-self:start}

.sheet-merits {
  list-style: none;
  padding: 0;
  margin: .6rem 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
  gap: .65rem;
}
.sheet-merits li {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .65rem .85rem;
  border: 1px solid #957e5b80;
  border-radius: 6px;
  background: #b9996320;
}
.sheet-merits img { object-fit: contain; flex: none; }
.sheet-merits small { display: block; margin-top: .25em; line-height: 1.5; }

#sheet-resources {
  display: flex;
  flex: 1 0 100%;
  flex-wrap: wrap;
  align-items: end;
  gap: .6rem;
}
#sheet-resources label { display: grid; gap: .25rem; margin: 0; }
#sheet-resources input { width: 5rem; min-width: 0; }

.map-context { max-height: calc(100dvh - 16px); overflow-y: auto; }
.map-context .context-status { padding: .4rem .75rem; font-size: .85rem; }
.map-context select { margin: .25rem .6rem; max-width: calc(100% - 1.2rem); }

.enc-order { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:.5rem; margin:.7rem 0 1.2rem; }
.enc-seat { display:grid; gap:.2rem; border:1px solid #9e876b80; border-radius:5px; padding:.55rem .7rem; }
.enc-seat span { font-size:.8rem; }
.enc-current { border:2px solid #967235; background:#b5995d26; }
.enc-line { display:flex; flex-wrap:wrap; align-items:center; gap:.7rem; padding:.4rem 0; }
.enc-line label { margin:0; }
#enc-turn button, #enc-management button { margin:.25rem; }
#enc-management { margin-top:1rem; }

#formal-reset-dialog {width:min(460px,calc(100vw - 32px))}
#formal-reset-dialog .row {justify-content:flex-end;gap:12px}

.dare-cast-row {display:flex;align-items:center;gap:.55rem;flex-wrap:wrap;padding:.45rem 0;border-bottom:1px solid #9b896654}
.dare-cast-row img {width:42px;height:42px;object-fit:cover;border-radius:50%}
.dare-cast-row span {flex:1;min-width:9rem}
#dare-presets details {padding:.7rem 0;border-bottom:1px solid #9b896654}
#dare-presets summary {cursor:pointer;font-weight:bold}
.flag-identity{display:flex;align-items:center;gap:12px;min-width:0}
.flag-identity>div{display:grid;gap:3px;overflow-wrap:anywhere}
.flag-identity small{color:#c1cbbb;font-size:11px}
.session-page-controls .flag-identity strong{font-size:15px;letter-spacing:.03em}
.session-page-controls button.flag-display{padding:0;background:none;border:0;box-shadow:none;flex:none}
.flag-art{--binding:#d7c49a;box-sizing:border-box;aspect-ratio:3/2;background:#343c34;border:3px solid var(--binding);outline:1px solid #302e2555;overflow:hidden}
.flag-art[data-trim="moss"]{--binding:#566845}.flag-art[data-trim="rust"]{--binding:#a45238}.flag-art[data-trim="navy"]{--binding:#364e69}
.flag-art img{display:block;width:100%;height:100%;object-fit:contain}
.flag-display .flag-art{width:72px;box-shadow:1px 2px 4px #10191466}
#flag-form{display:grid;gap:12px}
#flag-form h2{margin:0}
#flag-preview .flag-art{width:min(100%,300px);margin:auto;border-width:6px}
#flag-form fieldset{border:0;padding:0;margin:0}
.flag-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
#flag-form button.flag-choice{display:grid;justify-items:stretch;gap:4px;background:#efe8d7;color:#293c34;border:2px solid transparent;padding:4px;font-size:12px;line-height:1.2}
#flag-form button.flag-choice[aria-pressed="true"]{border-color:#47654a;background:#d6dfcd}
.flag-choice .flag-art{max-width:78px;width:100%;margin:auto;border:0}
#flag-form small,#flag-status{font-size:12px}
#flag-form label{display:grid;gap:4px}
#flag-form .row{display:flex;gap:8px}
#sheet{container-type:inline-size}
.sheet-hero:has(.sheet-flag-watermark){
 isolation:isolate;display:grid;grid-template-columns:auto minmax(0,1fr) minmax(0,min(38%,276px));
}
.sheet-hero:has(.sheet-flag-watermark)>:is(h1,div:not(.sheet-flag-watermark)){
 grid-column:2;overflow-wrap:anywhere;
}
.sheet-hero:has(.sheet-flag-watermark):not(:has(.sheet-portrait)){grid-template-columns:minmax(0,1fr) minmax(0,min(38%,276px))}
.sheet-hero:not(:has(.sheet-portrait)):has(.sheet-flag-watermark)>:is(h1,div:not(.sheet-flag-watermark)){grid-column:1}
.sheet-hero .sheet-flag-watermark{
 grid-column:-2/-1;grid-row:1;justify-self:end;width:100%;pointer-events:none;
 transform:rotate(2deg);z-index:-1;
 opacity:.24;mix-blend-mode:multiply;mask-image:linear-gradient(90deg,transparent,#000 32%);
}
@container (max-width:530px){
 .sheet-hero:has(.sheet-flag-watermark),
 .sheet-hero:has(.sheet-flag-watermark):not(:has(.sheet-portrait)){
  grid-template-columns:auto minmax(0,1fr);column-gap:clamp(12px,4cqw,20px);row-gap:6px;
  padding-right:3px;
 }
 .sheet-hero:has(.sheet-flag-watermark)>.sheet-portrait{grid-column:1;grid-row:1/3;align-self:start}
 .sheet-hero:has(.sheet-flag-watermark)>:is(h1,div:not(.sheet-flag-watermark)){grid-row:1}
 .sheet-hero .sheet-flag-watermark{grid-column:2;grid-row:2;width:min(100%,clamp(120px,40cqw,188px));opacity:.22}
 .sheet-hero:not(:has(.sheet-portrait)):has(.sheet-flag-watermark)>:is(h1,div:not(.sheet-flag-watermark)){grid-column:1/-1}
}
.handout-cache-controls{display:flex;align-items:center;gap:6px 10px;flex-wrap:wrap;margin:0 0 14px}
.handout-cache-controls button{font-size:12px;padding:5px 9px}
.handout-cache-controls small{font-size:12px;color:#526453}
#sound-desk{width:min(540px,calc(100vw - 28px));max-height:88dvh;overflow:auto}
#sound-desk section{padding:10px 0 14px;border-top:1px solid #ac987b88}
#sound-desk h3,#sound-desk p{margin:6px 0 10px}
#sound-desk select{width:100%}
.sound-actions,.sound-effects{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.sound-level{display:flex;align-items:center;gap:12px;margin:12px 0 0}
.sound-level input{flex:1;min-width:0}.sound-level output{min-width:3em}
#sound-desk[aria-busy=true] section{pointer-events:none;opacity:.8}
.sound-credits,.sound-feedback{font-size:13px}
.official-theme{display:flex;align-items:center;justify-content:center;gap:18px;padding:8px;background:#203831;color:#f1e6cd}
.official-theme iframe{border:0;width:min(356px,100%);height:200px;flex:none}
.official-theme small,.official-theme a{display:block;color:inherit;margin:6px 0}
@media(max-width:600px){.official-theme{flex-direction:column;gap:0}.official-theme>div{display:flex;align-items:center;gap:10px}}
#cartridge-desk .cartridge-screen{background:repeating-linear-gradient(0deg,#1d3d3d 0 2px,#234847 2px 4px);color:#f0deac;border:4px solid #605846;border-radius:14px;padding:12px 18px;margin:0 0 14px;box-shadow:inset 0 0 16px #102c2c}#cartridge-desk .cartridge-screen h3{color:#ffe3a0;margin:4px 0}#cartridge-desk fieldset{border:1px solid #8b8063;border-radius:8px;margin:12px 0}#cartridge-desk output{display:block;letter-spacing:.25em;font-size:1.35em}#cartridge-desk .row{flex-wrap:wrap;margin:8px 0}

#place-options{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(12rem,100%),1fr));gap:.35rem;max-height:48vh;overflow:auto;padding:.55rem;margin:.7rem 0;border:1px solid var(--line,#aa997d)}
#place-options .placement-option{display:flex;align-items:center;gap:.65rem;margin:0;padding:.45rem .6rem;cursor:pointer}
#place-options .placement-option:has(:checked){background:#557f7530;border-radius:.4rem}
#place-options input[type=checkbox]{width:1.1rem;height:1.1rem;flex:none;margin:0}
#place-options small{display:block;font-size:.8em;opacity:.78}
