/* Game UI kit pieces (js/gameui.js). Art frames come from the generated #gu-skin rules (.gu-f-*, .gu-i-*); the .gu-flat-*
   rules here are only the fallback look while a piece is missing from /art/manifest.json. */

/* painted backdrop: art at the top, fading into the void */
.gu-backdrop { position: relative; margin: -12px -12px 0; padding: 12px 12px 0; min-height: 100%;
  background: linear-gradient(180deg, rgba(13,16,21,.15) 0, rgba(13,16,21,.55) 180px, var(--bg-void) 420px), var(--gu-bg, none) top center / 100% auto no-repeat, var(--bg-void); }

/* title plate */
.gu-plate { display: flex; align-items: center; gap: 8px; min-height: 52px; margin-bottom: 10px; padding: 4px 8px; }
.gu-flat-plate { background: linear-gradient(180deg, #2A3342, #1A1F28); border: 1px solid #4A5870; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 0 #0A0C10; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.gu-plate-ic { flex: none; display: flex; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)); }
.gu-plate-t { flex: 1; margin: 0; font-size: 20px; text-shadow: 0 2px 0 rgba(0,0,0,.7); }
.gu-plate-r { flex: none; display: flex; gap: 4px; }

/* game tabs */
.gu-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; align-items: end; }
.gu-tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; padding: 4px 2px; color: var(--text-2); font: 600 12px var(--font-head); cursor: pointer; }
.gu-tab.on { min-height: 66px; color: #0D1015; }
.gu-tab .gu-tab-art { display: flex; height: 30px; align-items: center; filter: drop-shadow(0 2px 0 rgba(0,0,0,.55)); }
.gu-tab:not(.on) .gu-tab-art { opacity: .8; }
.gu-tab .gu-tab-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gu-tab:focus-visible { outline: 2px solid var(--signal-warn); outline-offset: 2px; }
.gu-flat-tab-on { background: linear-gradient(180deg, #F2C860, #D69A22); border: 1px solid #FFE3A0; box-shadow: 0 3px 0 #7A5410; }
.gu-flat-tab-off { background: linear-gradient(180deg, #2A3342, #1C222C); border: 1px solid #3E4A5E; box-shadow: 0 3px 0 #0A0C10; }
.gu-dot { position: absolute; top: 2px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--signal-warn); box-shadow: 0 0 0 2px #0D1015; }
.gu-dot.gu-i-badge_dot { width: 16px; height: 16px; border-radius: 0; box-shadow: none; }

/* badges, ribbon */
.gu-badge { display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; min-height: 18px; font: 700 10px var(--font-head); letter-spacing: .04em; color: #0D1015; background: var(--signal-warn); }
.gu-badge.art { min-width: 40px; min-height: 22px; background-color: transparent; }
.gu-badge.hot { background-color: #E0573A; color: #fff; }
.gu-badge.hot.art, .gu-badge.new.art { background-color: transparent; }
.gu-ribbon { display: inline-flex; align-items: center; min-height: 22px; padding: 0 12px; font: 600 12px var(--font-head); color: #0D1015; }
.gu-flat-ribbon { background: linear-gradient(180deg, #F2C860, #D69A22); clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%, 8px 50%); }
.gu-ribbon.warn.gu-flat-ribbon { background: linear-gradient(180deg, #F08A5D, #C8432B); color: #fff; }
.gu-ribbon.ok.gu-flat-ribbon { background: linear-gradient(180deg, #7EE0AE, #2F9C68); }

/* framed cards and section plates */
.gu-card { position: relative; display: grid; gap: 8px; padding: 10px; }
.gu-flat-card { background: linear-gradient(180deg, #1E2530, #151A21); border: 1px solid #3A4658; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 3px 0 #08090C; }
.gu-sec { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 8px; }
.gu-sec-t { margin: 0; padding: 2px 14px; font-size: 15px; text-shadow: 0 1px 0 rgba(0,0,0,.7); }
.gu-flat-sec { background: linear-gradient(90deg, #2A3342, rgba(42,51,66,0)); border-left: 3px solid var(--signal-warn); }
.gu-sec-sub { color: var(--text-2); font-size: 12px; text-align: right; }

/* item frame */
.gu-item { flex: none; display: inline-flex; align-items: center; justify-content: center; }
.gu-flat-slot { background: radial-gradient(circle at 50% 40%, #2C3646, #161B23 70%); border: 1px solid #4A5870; }

/* converter row */
.gu-convert { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; }
.gu-flat-convert { background: #0F1318; border: 1px solid #2D333D; box-shadow: inset 0 2px 6px rgba(0,0,0,.6); }
.gu-convert-in, .gu-convert-out { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.gu-arrow { display: inline-flex; align-items: center; gap: 1px; padding: 0 2px; }
.gu-arrow.art { flex: none; width: 36px; height: 24px; padding: 0; background: 0 0 / 288px 24px no-repeat; image-rendering: pixelated; animation: gu-arrow-run .8s steps(8) infinite; }
@keyframes gu-arrow-run { to { background-position: -288px 0; } }
.gu-arrow:not(.art) i { width: 7px; height: 12px; background: #6FE0B0; clip-path: polygon(0 0, 55% 0, 100% 50%, 55% 100%, 0 100%, 45% 50%); animation: gu-flow 1.2s infinite; }
.gu-arrow:not(.art) i:nth-child(2) { animation-delay: .2s; } .gu-arrow:not(.art) i:nth-child(3) { animation-delay: .4s; }
@keyframes gu-flow { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* gauge */
.gu-gauge { display: block; height: 12px; overflow: hidden; }
.gu-gauge.ornate { height: 16px; }
.gu-flat-gauge { background: #0B0E12; border: 1px solid #3A4658; box-shadow: inset 0 2px 3px rgba(0,0,0,.7); }
.gu-gauge-fill { display: block; height: 100%; min-width: 0; transition: width 1s linear; }
.gu-flat-fill { background: repeating-linear-gradient(135deg, #3FBF86 0 6px, #2F9C68 6px 12px); background-size: 17px 17px; animation: gu-stripes .8s linear infinite; }
@keyframes gu-stripes { to { background-position: 17px 0; } }

/* production line as a machine */
.gu-mach { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 6px 10px; }
.gu-flat-mach { background: linear-gradient(180deg, #232B37, #171C24); border: 1px solid #3E4A5E; box-shadow: inset 0 -3px 0 rgba(0,0,0,.35); }
.gu-mach.idle { outline: 2px dashed rgba(227,167,47,.7); outline-offset: -4px; }
.gu-mach.locked { opacity: .55; filter: grayscale(.7); }
.gu-mach-n { flex: none; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #0D1015; background: #9BA1AA; }
.gu-mach.busy .gu-mach-n { background: #6FE0B0; }
.gu-mach.idle .gu-mach-n { background: var(--signal-warn); }
.gu-mach-bay { position: relative; flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 60%, #2F3B4C, #0E1217 72%); border: 1px solid #2D333D; overflow: hidden; }
.gu-mach.busy .gu-mach-bay { box-shadow: inset 0 0 12px rgba(111,224,176,.35); }
.gu-mach-pop { display: flex; animation: gu-pop 2.4s ease-in-out infinite; }
@keyframes gu-pop { 0%, 55% { transform: translateY(0) scale(1); } 70% { transform: translateY(-6px) scale(1.12); } 85% { transform: translateY(0) scale(.96); } 100% { transform: translateY(0) scale(1); } }
.gu-mach-spark { position: absolute; left: 50%; bottom: 4px; width: 26px; height: 4px; margin-left: -13px; background: radial-gradient(ellipse, rgba(111,224,176,.9), transparent 70%); animation: gu-glow 1.2s ease-in-out infinite; }
@keyframes gu-glow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.gu-mach-b { flex: 1; min-width: 0; display: grid; gap: 4px; }
.gu-mach-t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gu-mach-t b { font-family: var(--font-head); }
.gu-mach-note { font-size: 12.5px; color: var(--text-2); }
.gu-mach.idle .gu-mach-note { color: var(--signal-warn); }

@media (prefers-reduced-motion: reduce) { .gu-mach-pop, .gu-mach-spark, .gu-flat-fill, .gu-arrow i, .gu-arrow.art { animation: none !important; } }
html.reduced .gu-mach-pop, html.reduced .gu-mach-spark, html.reduced .gu-flat-fill, html.reduced .gu-arrow i, html.reduced .gu-arrow.art { animation: none !important; }
/* one gold ribbon in the kit: tint it for warning (red-orange) and ok (green) */
.gu-ribbon.warn.gu-f-ribbon { filter: hue-rotate(-38deg) saturate(1.4); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.gu-ribbon.ok.gu-f-ribbon { filter: hue-rotate(75deg) saturate(1.1); }
