/* Yin & Yang page. Self-contained like costume-bonus.css, including the common header and footer. */
*, *::before, *::after { box-sizing: border-box; }
body { position: relative; font-family: 'Montserrat', Arial, sans-serif; margin: 0; min-height: 100vh; line-height: 1.5; display: flex; flex-direction: column; align-items: center; color: #F1D9A3; background: #3e2611; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; background: none; color: inherit; border: 0; }
a { color: inherit; }
.hidden { display: none !important; }
.yy-site-header { padding: 2.5rem 0 0; text-align: center; }
.yy-site-header #site-logo { width: 160px; height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 2px 8px #5d050533); transition: transform .2s; }
.yy-site-header #site-logo:hover { transform: scale(1.05); }
.yy-site-header h1 { font-size: 1.875rem; line-height: 2.25rem; font-weight: 700; color: #FECE58; margin: 1rem 0 .5rem; }
.yy-site-header p { color: #f1d9a3cc; margin-bottom: 2rem; font-size: 1rem; line-height: 1.5rem; }
.yy-footer { text-align: center; padding: 1.5rem 1rem; color: #f1d9a3b3; font-size: .85rem; line-height: 1.5; }
.yy-footer p { margin-top: .5rem; display: flex; justify-content: center; align-items: center; gap: .5rem; flex-wrap: wrap; }
.yy-footer a:hover { color: #FECE58; }
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .98; background: radial-gradient(ellipse at 65% 20%, #f1d9a3cc 0%, transparent 65%), radial-gradient(ellipse at 30% 85%, #5d050550 0%, transparent 70%), linear-gradient(135deg, #2d1a07 0%, #3e2611 45%, #f1d9a3 110%); }
.main-content { position: relative; z-index: 100; }
.dropdown { position: absolute; right: 2rem; top: 2rem; z-index: 110; }
#langBtn { display: flex; align-items: center; gap: .5rem; background: #341002; border-radius: .75rem; padding: .625rem 1.25rem; box-shadow: 0 4px 12px #0003; }
#langText { font-weight: 700; }
#langBtn svg { width: 1rem; height: 1rem; margin-left: .5rem; }
#langMenu { position: absolute; right: 0; margin-top: .5rem; width: 160px; background: #341002; border-radius: .75rem; overflow: hidden; box-shadow: 0 4px 12px #0003; }
#langMenu button { display: flex; align-items: center; gap: .5rem; text-align: left; width: 100%; padding: .5rem 1rem; }
#langBtn:hover, #langMenu button:hover { background: #5D0505; }
.flag-icon, #langIcon { display: inline-block; width: 1.25rem; height: 1.25rem; vertical-align: middle; }
.back-button { position: fixed; left: 2rem; top: 2rem; z-index: 1000; background: #341002; color: #F1D9A3; text-decoration: none; padding: .75rem; border-radius: 50%; box-shadow: 0 4px 12px rgba(93,5,5,.2); transition: all .3s ease; }
.back-button:hover { background: #5D0505; transform: scale(1.05); }
.back-button svg { display: block; width: 1.5rem; height: 1.5rem; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #FECE58; outline-offset: 2px; }

/* Content area */
.yy-main { max-width: 1280px; width: 100%; padding: 0 1rem 2rem; }
.yy-panel { background: #F1D9A3; border: 4px solid #FECE58; border-radius: .75rem; color: #341002; overflow: hidden; box-shadow: 0 4px 12px #5d05051a; margin-bottom: 2rem; min-width: 0; }
.yy-panel-head { background: #341002; color: #F1D9A3; padding: 1rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.yy-panel-head h2 { font-size: 1.25rem; line-height: 1.75rem; font-weight: 700; }
.yy-panel-body { padding: 1.5rem; }
.yy-head-actions { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.yy-head-actions .yy-select { flex: 1 1 12rem; }
.yy-btn { padding: .3rem .7rem; background: #341002; border: 2px solid #FECE58; border-radius: .5rem; color: #FECE58; font-weight: 700; font-size: .8rem; }
.yy-btn:hover { background: #5D0505; }
.yy-select { padding: .4rem .5rem; border-radius: .5rem; border: 2px solid #341002; background: #fffaf0; color: #341002; min-width: 0; max-width: 100%; }
/* Yang seals without a matching Yin: lightly greyed, still selectable */
.yy-select optgroup.is-dim, .yy-select optgroup.is-dim option { color: #9b8b7e; }
.yy-select-dark { background: #341002; color: #FECE58; border-color: #FECE58; font-weight: 700; font-size: .8rem; padding: .3rem .5rem; }
.yy-muted { color: #341002b3; font-size: .85rem; line-height: 1.5; }
.yy-center { text-align: center; margin-top: .5rem; }
.yy-count { font-size: .8rem; font-weight: 700; color: #FECE58; }
.yy-empty { padding: 1rem; background: #fffaf0; color: #341002; border-radius: .75rem; font-weight: 600; }

/* Badges: Yin dark, Yang light */
.yy-badge { display: inline-block; min-width: 3rem; text-align: center; padding: .1rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; }
.yy-badge-yin { background: #341002; color: #F1D9A3; }
.yy-badge-yang { background: #fffaf0; color: #341002; border: 1px solid #341002; }

/* Planner: diagram left, editor and links right */
.yy-planner { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.yy-diagram { position: relative; width: 100%; max-width: 22rem; aspect-ratio: 1; margin: 0 auto; background: #1c0a02 url("/resources/yin-yang/harmony.png") center / 100% 100% no-repeat; border: 3px solid #FECE58; border-radius: .75rem; box-shadow: inset 0 0 0 2px #341002, 0 4px 12px #0004; }
.yy-diagram > svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.yy-diagram path { fill: none; stroke: #F1D9A3; stroke-width: 3; opacity: .3; }
.yy-diagram path.is-linked { stroke: #FECE58; opacity: 1; filter: drop-shadow(0 0 3px #FECE58); }
.yy-diagram path.yy-line-weapon { stroke: #ff8a2a; filter: drop-shadow(0 0 3px #ff7a2a); }
.yy-diagram path.yy-line-glove { stroke: #3aa8ff; filter: drop-shadow(0 0 3px #2f9bff); }
.yy-node { position: absolute; transform: translate(-50%, -50%); width: 16%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 3px; padding: 0; transition: filter .15s, box-shadow .15s; }
.yy-node img { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.yy-node:hover { filter: brightness(1.2); }
.yy-node.is-set { box-shadow: 0 0 8px #F1D9A3aa; }
.yy-node.is-linked { box-shadow: 0 0 12px #fece58cc; }
.yy-node[aria-pressed="true"] { outline: 2px solid #FECE58; outline-offset: 5px; }
/* Slot with a Yin seal, like the in-game harmony window: coloured frame with a light running around it, Yin ball behind it at the outer corner.
   A Yang seal in harmony gets the frame in the colour of its Yin. */
@property --yy-spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes yy-spin { to { --yy-spin: 360deg; } }
.yy-yin-weapon { --yin-light: #ffb055; --yin-deep: #d9461a; --yin-glow: #ff7a2a99; }
.yy-yin-glove { --yin-light: #6fd6ff; --yin-deep: #1268d6; --yin-glow: #2f9bff99; }
.yy-node.has-frame { box-shadow: 0 0 12px var(--yin-glow); }
.yy-node.has-frame::after { content: ''; position: absolute; inset: -3px; border-radius: 3px; padding: 3px; pointer-events: none;
  background: conic-gradient(from var(--yy-spin), var(--yin-deep), var(--yin-light) 12%, var(--yin-deep) 30%, var(--yin-deep) 50%, var(--yin-light) 62%, var(--yin-deep) 80%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: yy-spin 3s linear infinite; }
.yy-node .yy-yin-ball { position: absolute; width: 70%; top: -55%; image-rendering: auto; pointer-events: none; }
/* The two images are game screenshots with frame: cut out just the ball */
.yy-yin-weapon .yy-yin-ball { left: -39%; clip-path: circle(39% at 46% 46%); }
.yy-yin-glove .yy-yin-ball { right: -34%; clip-path: circle(42% at 53% 45%); }
.yy-node .yy-yang-ball { position: absolute; width: 58%; left: 50%; top: -50%; transform: translateX(-50%); image-rendering: auto; pointer-events: none; }
.yy-side { display: grid; gap: 1rem; min-width: 0; }
.yy-editor { background: #fffaf0; border-radius: .6rem; padding: .9rem; display: grid; gap: .8rem; border-bottom: 3px solid #5D0505; }
.yy-editor-head { display: flex; align-items: center; gap: .6rem; }
.yy-editor-head img { width: 36px; height: 36px; image-rendering: pixelated; background: #341002; border-radius: .4rem; padding: 2px; }
.yy-editor-head h3 { font-size: 1.05rem; }
.yy-slot { display: grid; gap: .4rem; }
.yy-slot > .yy-badge { justify-self: start; }
.yy-slot.is-blocked > .yy-badge, .yy-slot.is-blocked .yy-slot-inputs { opacity: .45; }
.yy-select:disabled { cursor: not-allowed; }
.yy-slot-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; }
.yy-slot-text { font-size: .88rem; line-height: 1.5; }
.yy-slot-text b, .yy-entry-text b, .yy-link p b { color: #5D0505; font-weight: 800; }
.yy-slot-text strong { display: block; margin-top: .2rem; font-size: .8rem; }
.yy-result h3 { font-size: .95rem; margin-bottom: .5rem; }
.yy-link { background: #341002; color: #F1D9A3; border-radius: .6rem; padding: .7rem .9rem; margin-bottom: .6rem; border-left: 4px solid #FECE58; }
.yy-link h4 { color: #FECE58; font-size: .95rem; margin-bottom: .4rem; }
.yy-link ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.yy-link li { display: grid; grid-template-columns: auto 1fr; gap: .2rem .5rem; align-items: center; }
.yy-link li p { grid-column: 1 / -1; font-size: .85rem; line-height: 1.45; }
.yy-link p b { color: #FECE58; }
.yy-link .yy-badge-yin { background: #F1D9A3; color: #341002; }
.yy-link .yy-badge-yang { background: transparent; color: #F1D9A3; border-color: #F1D9A3; }
/* Yin pill in the colour of its piece: weapon orange, gloves blue */
.yy-badge-yin.yy-badge-yin-weapon { background: linear-gradient(#d0651a, #b04a0a); color: #fff; }
.yy-badge-yin.yy-badge-yin-glove { background: linear-gradient(#1f7fc8, #13609f); color: #fff; }
.yy-link-part { font-size: .78rem; font-weight: 700; opacity: .85; }
/* Same seal on several pieces: notice, the weaker copies are dimmed */
.yy-dup { font-size: .82rem; line-height: 1.45; font-weight: 700; color: #5D0505; background: #FECE5833; border-left: 4px solid #5D0505; border-radius: .4rem; padding: .45rem .7rem; margin-bottom: .6rem; }
.yy-link li.is-weaker { opacity: .5; }
.yy-loose-title { font-size: .85rem; margin: .4rem 0 .3rem; }
.yy-loose { margin: 0; padding-left: 1.1rem; font-size: .82rem; color: #341002b3; }

/* Reference */
.yy-filters { display: grid; gap: .9rem; margin-bottom: 1rem; }
.yy-filter-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.yy-field { display: grid; gap: .3rem; min-width: 0; }
.yy-field > span, .yy-field-label { font-weight: 700; font-size: .8rem; }
.yy-filter-select { appearance: none; -webkit-appearance: none; width: 100%; padding: .6rem 2.4rem .6rem .85rem; border: 2px solid #341002; border-radius: .6rem; background: #fffaf0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23341002' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right .8rem center / 1rem; color: #341002; font-weight: 700; font-size: .9rem; cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.yy-filter-select:hover { border-color: #5D0505; box-shadow: 0 0 0 3px #FECE5866; }
.yy-filter-select.is-active { background-color: #341002; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FECE58' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); color: #FECE58; border-color: #FECE58; box-shadow: 0 0 10px #FECE5866; }
.yy-filter-select option { background: #fffaf0; color: #341002; font-weight: 600; }
.yy-filter-level { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.yy-range { flex: 1 1 12rem; max-width: 24rem; accent-color: #5D0505; cursor: pointer; }
.yy-range-value { min-width: 1.5rem; font-size: 1.1rem; }
.yy-filter-reset { margin-left: auto; }
.yy-filter-reset[hidden] { display: none; }
.yy-ref { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr)); gap: 1rem; align-items: start; }
.yy-family { background: #fffaf0; border-radius: .6rem; overflow: hidden; border: 2px solid #341002; }
.yy-family-head { background: #341002; color: #F1D9A3; padding: .55rem .8rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.yy-family-head h3 { font-size: 1rem; color: #FECE58; }
.yy-family ul { list-style: none; margin: 0; padding: 0; }
.yy-entry { padding: .7rem .8rem; display: grid; gap: .4rem; }
.yy-entry + .yy-entry { border-top: 1px solid #34100222; }
.yy-entry-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.yy-entry-parts { display: flex; gap: .2rem; }
.yy-entry-parts img { width: 24px; height: 24px; image-rendering: pixelated; background: #341002; border-radius: .25rem; padding: 1px; }
.yy-entry-text { font-size: .86rem; line-height: 1.5; }
.yy-entry-text strong { display: block; font-size: .78rem; margin-top: .15rem; }
.yy-entry-targets { font-size: .78rem; font-weight: 700; color: #341002b3; }
.yy-steps { display: flex; flex-wrap: wrap; gap: .3rem; }
.yy-step { display: inline-flex; gap: .3rem; align-items: baseline; padding: .1rem .45rem; border-radius: .35rem; border: 1px solid #34100244; font-size: .72rem; color: #341002b3; }
.yy-step b { color: #341002; font-size: .8rem; }
.yy-step:hover { border-color: #341002; }
.yy-step.is-on { background: #5D0505; border-color: #5D0505; color: #F1D9A3cc; }
.yy-step.is-on b { color: #FECE58; }

/* Guide */
.yy-guide .yy-panel-body { line-height: 1.6; }
.yy-guide p + p { margin-top: .75rem; }
.yy-guide b { font-weight: 700; }
.yy-guide h3 { font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 .4rem; }
/* Item icon inside running text, same size as on the events page (inline w-5 h-5 mx-1) */
.yy-inline-icon { display: inline; width: 1.25rem; height: 1.25rem; margin: 0 .25rem; vertical-align: middle; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } .yy-node.has-frame::after { animation: none; } }
@media (max-width: 860px) { .yy-planner { grid-template-columns: 1fr; } }
@media (max-width: 767.98px) {
  .yy-panel-body { padding: 1rem; }
  .back-button { display: none; }
  #langText { display: none; }
  .yy-site-header #site-logo { width: 112px; }
  .yy-site-header h1 { font-size: 1.5rem; line-height: 2rem; }
  .yy-site-header p { font-size: .875rem; line-height: 1.25rem; }
  .yy-filter-row { grid-template-columns: 1fr; }
}
@media (max-width: 420px) { .yy-ref { grid-template-columns: 1fr; } .yy-slot-inputs { grid-template-columns: 1fr; } }
