/* Keep character selection at the left and preserve the original world view. */
.job.locked { opacity: .72; }
.job.locked.active { opacity: 1; }
#start:disabled { cursor: not-allowed; }
.job-category-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: #dfe8d5b3;
}
.job-category-tabs button {
  border: 0;
  border-radius: 7px;
  padding: 9px 1px;
  background: transparent;
  color: #71866c;
  font-size: 11px;
  white-space: nowrap;
}
.job-category-tabs button[aria-selected=true] {
  background: #426653;
  color: #fffdea;
}
.job-category-tabs button:focus-visible, .job:focus-visible {
  outline: 2px solid #a28e54;
  outline-offset: 2px;
}
#jobs {
  height: 236px;
  max-height: none;
  overflow: visible;
  padding: 0;
}
.job-category + .job-category { margin: 0; }
.job-category h3 { display: none; }
.job-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
#menu .job { min-height: 110px; padding: 7px 3px; }
#menu .job.active { padding: 6px 2px; }
#menu .job canvas { width: 62px; height: 62px; }
#menu .job strong { font-size: 12px; }
#menu .job small { font-size: 9px; }
body:not(.game) #menu {
  position: absolute;
  left: 4.5%;
  top: 100px;
  width: min(440px, 32vw);
  margin: 0;
  transform: none;
}
#menu h1 { font-size: 32px; margin: 10px 0; }
#menu .intro { font-size: 12px; margin: 0 0 15px; }
#menu .primary { padding: 13px 20px; margin-top: 14px; }
#menu .camp-actions { margin-top: 12px; }
#menu .camp-actions button { font-size: 11px; padding: 8px; }
#menu .hint { margin-top: 10px; font-size: 10px; }
@media (max-height: 850px) and (min-width: 901px) {
  body:not(.game) #menu { top: 105px; transform: scale(.82); transform-origin: top left; width: min(460px, 38vw); }
  #menu h1 { font-size: 28px; }
  #menu .intro { margin-bottom: 10px; }
  #menu .hint { display: none; }
}
@media (max-width: 900px) {
  body:not(.game) #menu { position: absolute; left: 4%; top: 90px; width: min(440px, 44vw); margin: 0; }
  #menu h1 { font-size: 24px; }
  #menu .intro { font-size: 10px; }
  #menu .hint { display: none; }
}
@media (max-width: 700px) {
  body:not(.game) #menu { left: 4%; top: 80px; width: 92%; }
  #menu h1 { font-size: 24px; }
  #menu .intro, #menu .eyebrow { display: none; }
  #menu .job canvas { width: 48px; height: 48px; }
  #menu .job { min-height: 94px; }
  #jobs { height: 204px; }
  .job-category-tabs button { font-size: 10px; padding: 8px 0; }
  #character-stats { display: none; }
  body:not(.game) { overflow: hidden; }
}

.run-inventory { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:16px 0; }
.run-inventory button { padding:10px; font-size:14px; }
.inventory-item { padding:14px 0; border-bottom:1px solid #8f927344; }
#item-buffs { color:#9a7134; font-weight:bold; }

.merchant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.merchant-grid .inventory-item { border: 1px solid #d6d9c4; border-radius: 12px; background: #fffaf0; display: flex; flex-direction: column; gap: 8px; }
.merchant-grid .inventory-item p { flex: 1; margin: 0; }
.merchant-grid button { margin-top: 6px; }
@media (max-width: 600px) { .merchant-grid { grid-template-columns: 1fr; } }

/* Keep the camp unobscured and place the compact adventurer sheet above it. */
body:not(.game) .vignette,
body:not(.game)[data-map] .vignette {
  background: linear-gradient(90deg, #f2f7e5f2 0%, #f2f7e5dc 30%, #f2f7e500 44%, transparent 100%);
}
body:not(.game) #character-stats {
  display: block;
  position: absolute;
  left: 43%;
  right: 4%;
  top: 100px;
  width: auto;
  margin: 0;
  padding: 14px 18px;
}
#character-stats .character-heading { margin: 4px 0; }
#character-stats .character-heading h2 { font-size: 22px; margin: 0; }
#character-stats #character-mode { margin: 6px 0; font-size: 11px; }
#character-stats #character-values { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px 10px; margin: 10px 0; }
#character-stats #character-values > div { display: block; padding: 3px 0; border: 0; }
#character-stats #character-values dt { font-size: 10px; }
#character-stats #character-values dd { font-size: 15px; margin: 3px 0 0; }
#character-stats #character-values dd small { font-size: 9px; }
#character-stats #character-start { font-size: 10px; margin: 5px 0 0; }
#character-stats .stat-footnote { display: none; }
@media (max-width: 900px) {
  body:not(.game) #character-stats { left: 51%; right: 3%; top: 90px; padding: 10px; }
  #character-stats #character-values { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
}
@media (max-width: 700px) {
  body:not(.game) #menu { width: 44%; left: 3%; }
  #menu .job-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #menu .job { min-height: 80px; }
  #menu .job canvas { width: 36px; height: 36px; }
  #menu h1 { font-size: 18px; }
  #character-stats .sheet-label span, #character-stats #character-mode, #character-stats #character-start { display: none; }
  #character-stats #character-values dt { font-size: 8px; }
  #character-stats #character-values dd { font-size: 12px; }
}

/* Crystal wish cards: the inner art window preserves the full illustration. */
.wish-stage { position: relative; display: grid; place-items: center; min-height: 410px; padding: 24px; perspective: 1100px; overflow: hidden; background: radial-gradient(ellipse at center, #e9dfb780, #d8e4d535 50%, transparent 72%); }
.wish-card { --card-color: #a98bd7; width: 236px; height: 344px; position: relative; transform-style: preserve-3d; color: #f6edda; filter: drop-shadow(0 12px 18px #223d3538); }
.wish-card.SR { --card-color: #81b9d6; }
.wish-card.SSR { --card-color: #dcb86b; }
.wish-card.UR { --card-color: #cf8eea; }
.wish-front, .wish-back { position: absolute; inset: 0; border: 3px solid var(--card-color); border-radius: 14px; backface-visibility: hidden; overflow: hidden; box-shadow: inset 0 0 0 5px #223a40, inset 0 0 0 6px var(--card-color); background: linear-gradient(145deg, #294842, #172c37 65%, #3a4057); }
.wish-front::before, .wish-front::after { content: '✧'; position: absolute; top: 9px; font-size: 24px; color: var(--card-color); z-index: 2; }
.wish-front::before { left: 12px; } .wish-front::after { right: 12px; }
.wish-back { transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: repeating-linear-gradient(45deg, #244438, #244438 12px, #2b4a4010 13px, #203f36 25px); }
.wish-back span { font-size: 108px; color: var(--card-color); text-shadow: 0 0 28px var(--card-color); }
.wish-back b { letter-spacing: 8px; } .wish-back small { letter-spacing: 3px; font-size: 9px; }
.wish-rarity { text-align: center; color: var(--card-color); letter-spacing: 5px; font: bold 20px Georgia, serif; padding: 13px 0 5px; }
.wish-art { height: 236px; margin: 0 14px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(ellipse, #e7e2ce88, #e7e2ce0a 72%); border-radius: 5px; }
.wish-art canvas { width: 100%; height: 100%; object-fit: contain; }
.wish-symbol { font-size: 110px; color: var(--card-color); text-shadow: 0 0 28px var(--card-color); }
.wish-card-caption { text-align: center; padding: 7px 12px; }
.wish-card-caption small { display: block; color: var(--card-color); letter-spacing: 3px; font-size: 9px; margin-bottom: 5px; }
.wish-card-caption b { display: block; font-size: 12px; line-height: 1.5; }
.wish-orbit { position: absolute; width: 320px; height: 320px; border: 1px solid #d6bb7655; border-radius: 50%; box-shadow: 0 0 70px #e8d5a533; }
.wish-revealing { animation: wishReveal 2.4s ease both; }
.wish-revealing .wish-card { animation: wishFlip 2.4s cubic-bezier(.2,.7,.2,1) both; }
.wish-revealing .wish-orbit { animation: wishBurst 2.4s ease both; }
@keyframes wishReveal { 0% { opacity: .6; } 42% { opacity: 1; } 100% { opacity: 1; } }
@keyframes wishFlip { 0%,35% { transform: rotateY(180deg) scale(.78); } 55% { transform: rotateY(90deg) scale(.9); filter: drop-shadow(0 0 35px #fff0b7); } 78% { transform: rotateY(-8deg) scale(1.04); } 100% { transform: rotateY(0) scale(1); } }
@keyframes wishBurst { 0% { transform: scale(.4) rotate(0); opacity: 0; } 48% { transform: scale(1); opacity: 1; box-shadow: 0 0 90px 35px #f8e7ad88; } 100% { transform: scale(1.3) rotate(90deg); opacity: 0; } }
.inventory-panel { max-width: 680px; }
.inventory-panel .inventory-item { padding: 14px 0; }
.tester-content button { margin: 10px 12px 10px 0; }
@media (prefers-reduced-motion: reduce) {
  .wish-revealing, .wish-revealing .wish-card, .wish-revealing .wish-orbit { animation-duration: .01s; }
}

.wish-art canvas { position: static; inset: auto; width: 100%; height: 100%; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; transform: none; }

.wish-grid { display: grid; place-items: center; position: relative; z-index: 1; }
.wish-card.wish-unopened { transform: rotateY(180deg); }
.wish-back { background: radial-gradient(ellipse at center, #355d61, #192f42 62%, #122732); border-color: #d8c18b; }
.wish-back::before, .wish-back::after { content: ''; position: absolute; inset: 15px; border: 1px solid #d8c18b99; border-radius: 8px; pointer-events: none; }
.wish-back::after { inset: 25px; border-color: #d8c18b44; }
.wish-back-ring { position: absolute; width: 140px; height: 140px; border: 1px solid #d8c18b88; transform: rotate(45deg); box-shadow: 0 0 0 10px #d8c18b0b, 0 0 0 11px #d8c18b33; }
.wish-back span, .wish-back b, .wish-back small, .wish-back em { z-index: 1; }
.wish-back em { color: #d8c18b; font-size: 15px; font-style: normal; }
.wish-back span { color: #e4d7ad; text-shadow: 0 0 26px #cdebf6aa; }
.wish-actions { display: flex; justify-content: center; gap: 18px; margin: 22px auto; flex-wrap: wrap; }
.gacha-content .wish-button { position: relative; min-width: 210px; padding: 16px 28px 16px 62px; display: grid; gap: 5px; text-align: left; border: 1px solid #acc8cb; border-radius: 10px; background: linear-gradient(135deg, #416b69, #243e4d); color: #f6eedb; box-shadow: inset 0 0 0 3px #ffffff0c, 0 5px 12px #253d3420; transition: transform .2s, box-shadow .2s; }
.gacha-content .wish-button span { position: absolute; left: 22px; top: 20px; font-size: 27px; color: #e3d4a7; }
.gacha-content .wish-button b { font-size: 17px; letter-spacing: 3px; }
.gacha-content .wish-button small { font-size: 11px; color: #d6e0d6; }
.gacha-content .wish-button-ten { background: linear-gradient(135deg, #80693f, #4f4235); border-color: #d8bc77; }
.gacha-content .wish-button:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 24px #c8b67c50; }
.gacha-content .wish-button:focus-visible { outline: 3px solid #bb9b59; outline-offset: 4px; }
.gacha-content .wish-button:disabled { opacity: .45; cursor: default; filter: grayscale(.6); }
.wish-revealing, .wish-revealing .wish-card, .wish-revealing .wish-orbit { animation-duration: 4.4s; }
.wish-grid.wish-batch { grid-template-columns: repeat(5, 132px); gap: 16px; }
.wish-batch .wish-card { width: 132px; height: 206px; }
.wish-batch .wish-art { height: 127px; margin: 0 8px; }
.wish-batch .wish-rarity { font-size: 14px; padding: 8px 0 3px; }
.wish-batch .wish-card-caption { padding: 6px 7px; }
.wish-batch .wish-card-caption b { font-size: 10px; line-height: 1.3; }
.wish-batch .wish-card-caption small { font-size: 7px; letter-spacing: 1px; margin-bottom: 3px; }
.wish-batch .wish-front::before, .wish-batch .wish-front::after { font-size: 12px; top: 7px; }
.wish-batch .wish-front::before { left: 8px; } .wish-batch .wish-front::after { right: 8px; }
.wish-batch .wish-symbol { font-size: 70px; }
.wish-batch .wish-back { gap: 10px; } .wish-batch .wish-back span { font-size: 60px; }
.wish-batch .wish-back b { font-size: 10px; letter-spacing: 3px; } .wish-batch .wish-back small { font-size: 6px; letter-spacing: 1px; }
.wish-batch .wish-back-ring { width: 75px; height: 75px; }
@media (max-width: 800px) { .wish-grid.wish-batch { grid-template-columns: repeat(3,132px); } }
@media (max-width: 510px) { .wish-grid.wish-batch { grid-template-columns: repeat(2,132px); gap: 10px; } .wish-stage { padding: 14px 4px; } }
@media (prefers-reduced-motion: reduce) { .wish-revealing, .wish-revealing .wish-card, .wish-revealing .wish-orbit { animation-duration: .01s; } }

/* Filters flatten 3D children; keep both card faces in the same 3D space. */
.wish-card { filter: none !important; }


.shield-track { height: 6px; background: #41667a55; margin-top: 5px; }
.shield-track i { background: linear-gradient(90deg,#6dafe0,#c5f2ff); }
#shield-health { color: #4b8caa; }
.role-active-description { background: #e8eee0; border: 1px solid #c6cfb1; border-radius: 12px; padding: 16px; margin-top: 18px; }
.talent-refund { padding: 5px 10px; margin: 4px 0 14px; font-size: 11px; }
#role-action { border: 1px solid #c6b775; background: #f5ebc8; color: #3e5c50; }

.talent-node[aria-disabled="true"] { opacity: .65; }

/* Role nodes are freely allocated cards, without the old narrow connector columns. */
.role-talent-tree > article {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  min-width: 0;
}
.role-talent-tree > article > h3 { grid-column: 1 / -1; margin: 0 0 4px; }
.role-talent-tree .talent-node { min-width: 0; width: 100%; height: 100%; min-height: 124px; white-space: normal; overflow-wrap: break-word; }
.role-talent-tree .talent-node b { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.role-talent-tree .talent-node b span { float: none; flex-shrink: 0; white-space: nowrap; }
.role-talent-tree .talent-node small, .role-talent-tree .talent-node em { line-height: 1.65; }
@media (max-width: 620px) {
  .role-talent-tree > article { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .role-talent-tree .talent-node { min-height: 110px; }
}

#menu .camp-actions { grid-template-columns: 1fr; }
