/* Shared exhibition components — dark ink, warm brass and oasis glass. */

.exhibition-icon { display: inline-block; flex: none; vertical-align: middle; }
.exhibition-topbar {
  position: relative;
  z-index: 40;
  color: #f6f0e5;
  background: linear-gradient(100deg, rgba(13, 22, 29, .94), rgba(16, 27, 34, .84));
  border-bottom: 1px solid rgba(232, 188, 117, .15);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.exhibition-topbar::after {
  content: "";
  position: absolute;
  width: 28%;
  height: 1px;
  bottom: -1px;
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(232, 188, 117, .65), transparent);
  pointer-events: none;
}
.exhibition-topbar-inner { min-height: 84px; }
.exhibition-topbar-actions { row-gap: 8px; }
.exhibition-topbar-actions .sand-button { min-height: 38px; }
.project-logo { color: #e8bc75; flex-shrink: 0; }
.project-logo-symbol { width: 52px; height: 52px; flex: none; }
.project-logo-symbol svg { width: 100%; height: 100%; }
.project-logo-name { color: #f6f0e5; font-size: 20px; font-weight: 600; letter-spacing: .16em; }
.project-logo-subtitle { color: #9eaeb3; margin-top: 6px; font-size: 10px; line-height: 1.5; letter-spacing: .08em; }
.project-logo-small .project-logo-symbol { width: 44px; height: 44px; }
.project-logo-small .project-logo-name { font-size: 18px; }
.project-logo-small .project-logo-subtitle { font-size: 9px; margin-top: 5px; letter-spacing: .12em; }

.role-portrait {
  position: relative;
  display: block;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(232, 188, 117, .2);
  border-radius: 18px;
  background: radial-gradient(ellipse at 50% 10%, #3b4240 0, #18262e 55%, #101921 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
  transition: border-color .24s ease, box-shadow .24s ease;
}
.role-portrait-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0;
  transition: opacity .3s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
}
.role-portrait.is-loaded .role-portrait-image { opacity: 1; }
.role-portrait-fallback { position: absolute; inset: 0; opacity: .86; }
.role-portrait-fallback svg { width: 100%; height: 100%; }
.role-portrait-edge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 241, 212, .04);
  background: linear-gradient(180deg, rgba(8, 16, 23, .02) 60%, rgba(8, 16, 23, .3));
}
@media (hover: hover) {
  .agent-card:hover .role-portrait-motion .role-portrait-image,
  .exhibition-agent-card:hover .role-portrait-motion .role-portrait-image { transform: scale(1.035); }
  .agent-card:hover .role-portrait,
  .exhibition-agent-card:hover .role-portrait { border-color: rgba(232, 188, 117, .48); }
}
.ai-avatar {
  position: relative;
  flex: none;
  border-radius: 50%;
  background: #1b2d35;
  box-shadow: 0 0 0 1px rgba(232, 188, 117, .4), 0 4px 14px rgba(0, 0, 0, .22);
}
.ai-avatar img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; object-position: center 30%; opacity: 0; transition: opacity .2s ease; }
.ai-avatar img.is-loaded { opacity: 1; }
.ai-avatar-fallback { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }
.ai-avatar-fallback svg { display: block; width: 100%; height: 120%; transform: scale(1.3); transform-origin: 50% 32%; }
.ai-avatar-status { position: absolute; right: -1px; bottom: 0; width: 10px; height: 10px; border: 2px solid #14222a; border-radius: 50%; background: #8bcbc2; }
.ai-avatar.is-thinking { animation: exhibition-thinking 2s ease-in-out infinite; }
@keyframes exhibition-thinking {
  0%, 100% { box-shadow: 0 0 0 1px rgba(139, 203, 194, .5), 0 0 0 4px rgba(139, 203, 194, .02); }
  50% { box-shadow: 0 0 0 1px rgba(139, 203, 194, .75), 0 0 0 4px rgba(139, 203, 194, .1); }
}

.exhibition-modal-backdrop {
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: rgba(3, 8, 13, .79);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: exhibition-backdrop-in .16s ease both;
}
@keyframes exhibition-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.exhibition-dialog.glass-card {
  position: relative;
  min-width: 0;
  max-height: calc(100dvh - 40px);
  color: #f6f0e5;
  border: 1px solid rgba(232, 188, 117, .23);
  border-radius: 24px;
  background: linear-gradient(145deg, #1a2932 0%, #111d25 72%);
  box-shadow: 0 34px 100px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(246, 240, 229, .07);
  padding: clamp(22px, 3vw, 36px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  animation: exhibition-dialog-in .2s ease both;
}
@keyframes exhibition-dialog-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.exhibition-dialog:focus { outline: none; }
.exhibition-dialog :is(button, a, input, select, textarea, [tabindex]):focus-visible,
.stage-stratum:focus-visible,
.media-thumb:focus-visible,
.upload-zone:focus-visible,
.exhibition-topbar :is(button, a):focus-visible {
  outline: 2px solid #8bcbc2;
  outline-offset: 4px;
}
.exhibition-dialog :is(video, audio) { max-width: 100%; }

.stage-stratum {
  display: block;
  width: 100%;
  min-height: 76px;
  height: 76px;
  padding: 0;
  text-align: left;
  font: inherit;
  border-radius: 14px;
  color: #d9e0dc;
  border: 1px solid rgba(158, 177, 178, .2);
  background: linear-gradient(100deg, #1b2c35, #17252d);
  box-shadow: none;
  transition: border-color .2s ease, background .2s ease;
}
.stage-stratum:hover { transform: none; border-color: rgba(232, 188, 117, .55); }
.stage-stratum.completed { color: #cde3de; background: linear-gradient(110deg, #1b3437, #182b32); border-color: rgba(139, 203, 194, .32); }
.stage-stratum.current { color: #f4e2c3; background: linear-gradient(110deg, #3a352c, #202a2d); border-color: rgba(232, 188, 117, .62); box-shadow: inset 3px 0 0 #e8bc75; }
.stage-stratum.locked { color: #a1afb5; background: #15222b; border-color: rgba(158, 177, 178, .12); opacity: .7; }
.stage-stratum.locked:hover { border-color: rgba(158, 177, 178, .12); }
.stage-stratum-mark { width: 40px; height: 40px; background: rgba(232, 188, 117, .08); border: 1px solid rgba(232, 188, 117, .22); color: #e8bc75; font-size: 17px; font-family: "Noto Serif SC", "Songti SC", serif; }
.stage-stratum.completed .stage-stratum-mark { color: #8bcbc2; border-color: rgba(139, 203, 194, .3); background: rgba(139, 203, 194, .07); }
.stage-stratum.locked .stage-stratum-mark { color: #94a6ac; border-color: rgba(139, 160, 168, .2); background: rgba(139, 160, 168, .05); }
.stage-stratum .sand-flow { opacity: .1; animation-duration: 7s; }
.progress-ring { display: block; flex: none; }
.progress-ring circle { transition: stroke-dashoffset .6s ease; }

.exhibition-sand-jar {
  max-width: 240px;
  border-radius: 22px 22px 42px 42px;
  border: 1px solid rgba(232, 188, 117, .35);
  background: linear-gradient(135deg, rgba(139, 203, 194, .08), transparent 55%), #111e27;
  box-shadow: inset 10px 0 20px rgba(246, 240, 229, .025), inset 0 1px 0 rgba(246, 240, 229, .12), 0 16px 44px rgba(0, 0, 0, .28);
}
.sand-jar-grid { position: absolute; inset: 15% 12%; background: repeating-linear-gradient(0deg, transparent, transparent calc(25% - 1px), rgba(232, 188, 117, .13) calc(25% - 1px), rgba(232, 188, 117, .13) 25%); }
.exhibition-sand-jar::after { content: ""; position: absolute; top: 8%; bottom: 8%; width: 2px; left: 7%; background: linear-gradient(transparent, rgba(246, 240, 229, .17), transparent); pointer-events: none; }
.exhibition-sand-jar .sand-jar-layer { background-blend-mode: luminosity; box-shadow: inset 0 14px 26px rgba(9, 18, 24, .16); }
.exhibition-sand-jar .sand-jar-layer span { letter-spacing: .12em; }
.weapon-icon { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .2)); }
.weapon-card:hover .weapon-icon { transform: translateY(-2px); filter: drop-shadow(0 5px 12px rgba(139, 203, 194, .12)); }
.weapon-icon.equipped { filter: drop-shadow(0 0 8px rgba(139, 203, 194, .2)); }

.upload-zone { border-color: rgba(139, 203, 194, .3); background: rgba(139, 203, 194, .035); border-radius: 16px; }
.upload-zone:hover, .upload-zone.dragover { border-color: #8bcbc2; background: rgba(139, 203, 194, .08); }
.upload-symbol { width: 54px; height: 54px; margin-left: auto; margin-right: auto; display: grid; place-items: center; border-radius: 16px; color: #8bcbc2; background: rgba(139, 203, 194, .09); border: 1px solid rgba(139, 203, 194, .2); }
.media-thumb { border-color: rgba(232, 188, 117, .2); background: #1a2932; }
.media-thumb:hover { transform: none; border-color: rgba(232, 188, 117, .5); }
.media-thumb > button { min-width: 30px; min-height: 30px; background: rgba(5, 12, 18, .8); }
.media-thumb:focus-within > button { opacity: 1; }
.exhibition-fullscreen-control { display: inline-flex; position: relative; }
.exhibition-fullscreen { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.exhibition-fullscreen-message { position: absolute; top: calc(100% + 12px); right: 0; z-index: 1100; width: min(290px, calc(100vw - 32px)); padding: 14px 16px; color: #e6ece8; background: #1c3038; border: 1px solid rgba(139, 203, 194, .36); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .35); font-size: 12px; line-height: 1.7; text-align: left; white-space: normal; }

@media (hover: none) { .media-thumb > button { opacity: 1; } }
@media (max-width: 640px) {
  .exhibition-topbar-inner { min-height: 72px; row-gap: 14px; }
  .project-logo { gap: 9px; }
  .project-logo-symbol { width: 40px; height: 40px; }
  .project-logo-name { font-size: 17px; letter-spacing: .1em; }
  .project-logo-subtitle { max-width: 230px; font-size: 9px; }
  .project-logo-small .project-logo-symbol { width: 36px; height: 36px; }
  .project-logo-small .project-logo-name { font-size: 16px; }
  .exhibition-modal-backdrop { padding: 12px; }
  .exhibition-dialog.glass-card { padding: 22px 18px; border-radius: 18px; max-height: calc(100dvh - 24px); }
  .role-portrait { border-radius: 14px; }
  .stage-stratum { min-height: 72px; height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .role-character, .role-portrait, .role-portrait-image, .ai-avatar, .exhibition-modal-backdrop,
  .exhibition-dialog.glass-card, .stage-stratum, .sand-flow, .progress-ring circle, .sand-jar-layer,
  .weapon-icon, .weapon-card, .ring-float, .pulse-glow { animation: none !important; transition: none !important; }
  .agent-card:hover .role-character, .agent-card:hover .role-portrait-image,
  .exhibition-agent-card:hover .role-portrait-image, .weapon-card:hover .weapon-icon { transform: none !important; }
}
