/* Electron Sea Foundry: the work order + choice cards and the foundry scene inside the practice shell's stage. */
.esf { position: absolute; inset: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 12px; padding: 8px 12px; }
.esf-panel { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 2px; }
.esf-ticket { padding: 8px 14px 10px; border-radius: var(--tlg-radius-lg, 14px); border: 2px solid #9a4a17; background: #fdf6ee; color: #2a1a10;
  box-shadow: inset 0 0 0 3px #ffffff, 0 2px 6px rgba(0, 0, 0, .08); }
.esf-ticket-k { margin: 0 0 4px; font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #8a3f10; }
.esf-given { margin: 0; display: grid; gap: 4px; }
.esf-given div { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; font-size: 17px; line-height: 1.3; border-top: 1px dashed #dcc3ab; padding-top: 4px; }
.esf-given div:first-child { border-top: 0; padding-top: 0; }
.esf-given dt { font-weight: 600; color: #5f4636; flex: none; }
.esf-given dd { margin: 0; text-align: right; font-weight: 800; }
html[data-theme="dark"] .esf-ticket { background: #2a1f18; color: #f6e9dc; border-color: #e09a62; box-shadow: inset 0 0 0 3px #1c140f; }
html[data-theme="dark"] .esf-ticket-k { color: #f0b47e; }
html[data-theme="dark"] .esf-given dt { color: #d9c2ad; }
html[data-theme="dark"] .esf-given div { border-color: #5a4334; }

.esf-field { display: flex; flex-direction: column; gap: 6px; }
.esf-field-k { margin: 0; font-size: 16px; font-weight: 800; }
.esf-choices { display: grid; grid-template-columns: 1fr; gap: 7px; }
.esf-choice { font: inherit; display: flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 46px; padding: 7px 12px;
  border-radius: 12px; border: 2px solid var(--tlg-border, #a89584); background: var(--tlg-surface, #ffffff); color: var(--tlg-text, #2a1a10);
  font-size: 17px; line-height: 1.25; text-align: left; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.esf-choice:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0, 0, 0, .12); }
.esf-choice:focus-visible { outline: 3px solid #1f6fb8; outline-offset: 2px; }
.esf-choice-t { font-weight: 700; }
.esf-choice::before { content: ''; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; opacity: .6; }
.esf-choice[aria-pressed="true"] { border-color: #9a4a17; background: #fbe7d6; box-shadow: inset 0 0 0 2px #9a4a17; }
.esf-choice[aria-pressed="true"]::before { opacity: 1; background: #9a4a17; box-shadow: inset 0 0 0 3px #fbe7d6; border-color: #9a4a17; }
.esf-choice:disabled { cursor: default; }
html[data-theme="dark"] .esf-choice[aria-pressed="true"] { background: #43291a; border-color: #f0b47e; box-shadow: inset 0 0 0 2px #f0b47e; }
html[data-theme="dark"] .esf-choice[aria-pressed="true"]::before { background: #f0b47e; border-color: #f0b47e; box-shadow: inset 0 0 0 3px #43291a; }
.esf-msg { margin: 0; min-height: 1.2em; font-size: 16px; font-weight: 700; color: var(--tlg-danger, #b42318); }
.esf-msg:empty { display: none; }
html[data-theme="dark"] .esf-msg { color: #ffb4a8; }
.esf-about { font-size: 16px; line-height: 1.4; color: var(--tlg-text-muted, #4d4038); }
.esf-about summary { cursor: pointer; font-weight: 700; }
.esf-about p { margin: 6px 0 0; }

.esf-view { position: relative; min-width: 0; min-height: 0; display: flex; align-items: flex-start; justify-content: center; }
.esf-scene { position: relative; width: 100%; aspect-ratio: 720 / 640; border-radius: var(--tlg-radius-lg, 14px); overflow: hidden; border: 2px solid var(--tlg-border, #b8a594); user-select: none; -webkit-user-select: none; }
.esf-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; font-family: inherit; }
.esf-wall { fill: url(#esf-wall); }
.esf-brick { fill: url(#esf-brick); }
.esf-floor { fill: #a89889; }
html[data-theme="dark"] .esf-wall { fill: url(#esf-wall-d); }
html[data-theme="dark"] .esf-brick { fill: url(#esf-brick-d); }
html[data-theme="dark"] .esf-floor { fill: #2a221d; }
/* labels drawn straight on the wall: a light halo keeps them readable in both themes */
.esf-tag { paint-order: stroke; stroke: #fbf4ea; stroke-width: 5px; stroke-linejoin: round; }
html[data-theme="dark"] .esf-tag { fill: #fbeee0; stroke: #1c1410; }
.esf-fire { animation: esf-flicker 1.6s ease-in-out infinite; }
.esf-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: esf-flame 1.1s ease-in-out infinite; }
@keyframes esf-flicker { 0%, 100% { opacity: 1; } 40% { opacity: .86; } 70% { opacity: .95; } }
@keyframes esf-flame { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.88) skewX(3deg); } }

.esf-badge { position: absolute; left: 2%; right: 2%; bottom: 1.6%; padding: 7px 14px; border-radius: 12px; font-size: 16px; font-weight: 700; line-height: 1.3;
  background: rgba(255, 255, 255, .96); color: #2a1a10; border: 3px solid #9a4a17; box-shadow: 0 3px 10px rgba(0, 0, 0, .25); animation: esf-pop .3s ease-out; pointer-events: none; }
.esf-badge--ok { border-color: #2f8a63; }
.esf-badge--bad { border-color: #c8372d; }
html[data-theme="dark"] .esf-badge { background: rgba(28, 20, 16, .96); color: #f6e9dc; }
@keyframes esf-pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.esf-example-svg { display: block; width: 100%; height: auto; max-height: 460px; }
.esf-start-svg { display: block; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .esf-fire, .esf-flame, .esf-badge { animation: none; } .esf-choice { transition: none; } }

@media (max-width: 1100px) { .esf { grid-template-columns: 300px minmax(0, 1fr); } }
@media (max-width: 900px) {
  .esf { position: static; grid-template-columns: 1fr; }
  .esf-view { display: block; }
  .esf-scene { width: 100% !important; height: auto !important; }
}
