/* Reusable components: buttons, forms, cards, pills, tabs, tables, dropdowns, toasts. */

/* Buttons ---------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font: 600 .95rem/1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: .88rem; }
.btn--lg { min-height: 50px; padding: 0 26px; font-size: 1.02rem; }
.btn--block { width: 100%; }
.btn--primary { background: linear-gradient(135deg, #B7A1FF, var(--violet)); color: #0B0F1E; box-shadow: 0 6px 18px rgba(155, 123, 255, .3); }
.btn--primary:hover { color: #0B0F1E; box-shadow: 0 8px 24px rgba(155, 123, 255, .5); }
.btn--cta { background: linear-gradient(135deg, #FFB84D, var(--orange)); color: #0B0F1E; box-shadow: 0 6px 18px rgba(255, 159, 46, .28); }
.btn--cta:hover { color: #0B0F1E; box-shadow: 0 8px 26px var(--orange-glow); }
.btn--ghost { background: rgba(155, 123, 255, .06); color: var(--text); border-color: var(--border); }
.btn--ghost:hover { color: #fff; border-color: var(--violet); background: var(--violet-dim); }
.btn--danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(255, 122, 138, .4); }
.btn--danger:hover { background: rgba(255, 122, 138, .22); color: #fff; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { color: var(--text); background: var(--violet-dim); }
.icon-btn--danger:hover { color: var(--danger); background: var(--danger-dim); }
.badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 99px;
  background: var(--orange); color: #0B0F1E; font: 700 .68rem/1 var(--font-mono);
}

/* Forms ---------------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form--grid .field--wide, .form--grid .form__actions { grid-column: 1 / -1; }
.form__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .fieldset legend { font-weight: 500; font-size: .92rem; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.optional { color: var(--text-2); font-weight: 400; font-size: .82rem; }
.field-hint { font-size: .82rem; color: var(--text-2); }
.field-error { font-size: .85rem; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 14px;
  background: var(--panel-deep); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.textarea--mono { font: 400 .88rem/1.5 var(--font-mono); }
.select { padding-right: 34px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A9A5D6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input::placeholder, .textarea::placeholder { color: rgba(169, 165, 214, .55); }
.input:hover, .select:hover, .textarea:hover { border-color: #3A4072; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--pink); box-shadow: var(--ring); }
.input:disabled { opacity: .6; cursor: not-allowed; }
.input[type="search"] { -webkit-appearance: none; appearance: none; }
.check, .radio { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .92rem; color: var(--text-2); }
.check input, .radio input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--orange); flex: none; }
.check a { color: var(--pink); }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { padding: 0; margin-bottom: 8px; }
.radios { display: grid; gap: 10px; }
.radio { padding: 12px 14px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--panel-deep); }
.radio:has(input:checked) { border-color: var(--violet); background: var(--violet-dim); }
.radio span { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.radio small { color: var(--text-2); font-size: .82rem; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; color: #0B0F1E; font: 700 .9rem var(--font-display); cursor: pointer; border: 2px solid transparent; }
.swatch input:checked + span { border-color: #fff; box-shadow: 0 0 0 3px var(--violet-line); }
.swatch input:focus-visible + span { box-shadow: var(--ring); }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form .select { width: auto; min-width: 150px; }
.inline { display: inline; }
@media (max-width: 640px) { .form--grid { grid-template-columns: minmax(0, 1fr); } }

/* Cards and stats ---------------------------------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 22px; }
.card__title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 14px; }
.card__title .icon { color: var(--orange); }
.card > * + * { margin-top: 14px; }
.card .card__title + * { margin-top: 0; }
.card--danger { border-color: rgba(255, 122, 138, .35); }
.card--danger .card__title .icon { color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat__value { font: 800 2rem/1.1 var(--font-display); }
.stat__value--orange { color: var(--orange); }
.stat__label { color: var(--text-2); font-size: .85rem; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat__value { font-size: 1.6rem; } }

/* Progress bars --------------------------------------------------------------------------- */
.progress { height: 8px; border-radius: 99px; background: var(--border-subtle); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), #FFC46B); box-shadow: 0 0 12px var(--orange-glow); transition: width .35s ease; }
.progress--lg { height: 12px; }
.progress--done > i { background: linear-gradient(90deg, var(--violet), var(--pink)); box-shadow: 0 0 14px rgba(155, 123, 255, .6); }
.rbar { height: 4px; border-radius: 99px; background: var(--border-subtle); overflow: hidden; margin-top: 6px; }
.rbar > i { display: block; height: 100%; background: var(--violet); border-radius: inherit; }

/* Pills, chips and tags ------------------------------------------------------------------------ */
.pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font: 600 .68rem/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; background: var(--violet-dim); color: var(--pink); white-space: nowrap; }
.pill--soon { background: var(--orange-dim); color: var(--orange); }
.pill--update { background: rgba(91, 214, 138, .14); color: var(--success); }
.pill--maintenance { background: var(--orange-dim); color: var(--orange); }
.pill--dev { background: var(--violet-dim); color: var(--violet); }
.pill--st-new { background: rgba(169, 165, 214, .16); color: var(--text); }
.pill--st-reviewing { background: var(--violet-dim); color: var(--pink); }
.pill--st-planned { background: var(--orange-dim); color: var(--orange); }
.pill--st-done { background: rgba(91, 214, 138, .16); color: var(--success); }
.pill--st-declined { background: var(--danger-dim); color: var(--danger); }
.pill--private { background: rgba(169, 165, 214, .14); color: var(--text-2); }
.pill--status { position: absolute; top: 10px; right: 10px; background: rgba(11, 15, 30, .82); border: 1px solid var(--border); color: var(--text); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.pill--playing { color: var(--orange); border-color: rgba(255, 159, 46, .5); }
.pill--completed { color: var(--pink); }
.pill--platinum { color: #0B0F1E; background: linear-gradient(135deg, #C4B3FF, #9B7BFF); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 99px; background: var(--panel-deep); border: 1px solid var(--border); color: var(--text-2); font: 500 .85rem var(--font-body); cursor: pointer; transition: all .15s; }
.chip:hover { color: var(--text); border-color: var(--violet); }
.chip.is-active { background: var(--violet); border-color: var(--violet); color: #0B0F1E; font-weight: 600; }
.chip__n { font: 500 .72rem var(--font-mono); opacity: .8; }
.tag { display: inline-block; margin-left: 4px; padding: 2px 7px; border-radius: 6px; font: 600 .66rem/1.5 var(--font-mono); letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; background: rgba(169, 165, 214, .14); color: var(--text-2); }
.tag--missable { background: rgba(255, 122, 138, .14); color: var(--c-missable); }
.tag--grind { background: rgba(255, 159, 46, .14); color: var(--c-grind); }
.tag--hard { background: rgba(155, 123, 255, .16); color: var(--c-hard); }
.tag--bug { background: rgba(255, 138, 216, .14); color: var(--c-bug); }
.tag--online { background: rgba(90, 209, 230, .14); color: var(--c-online); }
.tag--seed { background: rgba(91, 214, 138, .14); color: var(--c-seed); }

/* Tabs and pager -------------------------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border-subtle); padding-bottom: 12px; }
.tabs__item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-weight: 500; }
.tabs__item:hover { color: var(--text); background: var(--violet-dim); }
.tabs__item.is-active { background: var(--violet-dim); color: #fff; box-shadow: inset 0 0 0 1px var(--violet-line); }
.tabs__count { font: 500 .75rem var(--font-mono); background: var(--border-subtle); padding: 1px 7px; border-radius: 99px; }
.pager { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.pager__item { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); color: var(--text-2); text-decoration: none; }
.pager__item:hover { border-color: var(--violet); color: var(--text); }
.pager__item.is-active { background: var(--violet); color: #0B0F1E; border-color: var(--violet); font-weight: 600; }

/* Tables ------------------------------------------------------------------------------------------- */
.tablewrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font: 600 .72rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table__act { text-align: right; white-space: nowrap; }
.table__act form { display: inline; }

/* Dropdowns ------------------------------------------------------------------------------------------ */
.dropdown { position: relative; }
.dropdown__panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; min-width: 220px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.dropdown--right .dropdown__panel { left: auto; right: 0; }
.dropdown__panel--wide { width: min(420px, 92vw); }
.dropdown__panel a, .dropdown__panel button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 8px; color: var(--text); text-decoration: none; cursor: pointer; text-align: left; font: 500 .92rem var(--font-body); }
.dropdown__panel a:hover, .dropdown__panel button:hover { background: var(--violet-dim); }
.dropdown__title { font: 600 .7rem var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); padding: 8px 12px 6px; }
.dropdown__who { display: flex; flex-direction: column; padding: 8px 12px 10px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
.dropdown__who span { color: var(--text-2); font-size: .85rem; }
.dropdown__empty { padding: 10px 12px; color: var(--text-2); }
.dropdown__more { justify-content: center; color: var(--pink) !important; border-top: 1px solid var(--border-subtle); margin-top: 4px; border-radius: 0 0 8px 8px !important; }
.news-item { display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px !important; }
.news-item__title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-item__date { color: var(--text-2); font-size: .78rem; }
.topbar__newsbtn { display: flex; align-items: center; gap: 10px; max-width: 100%; min-height: 40px; padding: 0 14px; background: var(--panel); border: 1px solid var(--border-subtle); border-radius: 99px; color: var(--text-2); cursor: pointer; font: 500 .88rem var(--font-body); }
.topbar__newsbtn:hover, .topbar__newsbtn[aria-expanded="true"] { border-color: var(--violet); color: var(--text); }
.topbar__newsbtn .icon:first-child { color: var(--orange); }
.topbar__newstext { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__newstext strong { color: var(--orange); font-weight: 600; }
.usermenu { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; background: none; border: 1px solid transparent; border-radius: 99px; color: var(--text); cursor: pointer; }
.usermenu:hover, .usermenu[aria-expanded="true"] { background: var(--violet-dim); border-color: var(--border); }
.usermenu__name { font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #0B0F1E; font: 700 .8rem var(--font-display); flex: none; }
.avatar--xl { width: 88px; height: 88px; font-size: 1.9rem; }

/* Messages ----------------------------------------------------------------------------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel); font-size: .95rem; }
.flash .icon { margin-top: 2px; }
.flash--success { border-color: rgba(91, 214, 138, .5); } .flash--success .icon { color: var(--success); }
.flash--error { border-color: rgba(255, 122, 138, .55); background: var(--danger-dim); } .flash--error .icon { color: var(--danger); }
.flash--info { border-color: var(--violet-line); } .flash--info .icon { color: var(--violet); }
.notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 10px; background: var(--orange-dim); border: 1px solid rgba(255, 159, 46, .4); }
.notice .icon { color: var(--orange); }
.notice p { flex: 1; min-width: 200px; font-size: .92rem; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; gap: 10px; align-items: center; max-width: min(380px, 90vw); padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--violet-line); box-shadow: var(--shadow); animation: toast-in .25s ease; }
.toast--success { border-color: rgba(255, 159, 46, .6); }
.toast--error { border-color: rgba(255, 122, 138, .6); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 960px) { .toast-region { right: 12px; left: 12px; bottom: 84px; align-items: stretch; } }

/* Top-bar panel with tabs (Updates / Maintenance / Suggestions) ------------------------------------------------ */
.news-panel { padding: 6px; }
.news-panel .minitabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 6px; background: var(--panel-deep); border-radius: 10px; }
.news-panel .minitabs__tab { flex: 1; width: auto; justify-content: center; gap: 6px; padding: 8px 6px; border-radius: 8px; color: var(--text-2); font: 600 .8rem var(--font-body); white-space: nowrap; }
.news-panel .minitabs__tab:hover { color: var(--text); background: var(--violet-dim); }
.news-panel .minitabs__tab[aria-selected="true"] { background: var(--violet); color: #0B0F1E; }
.minitabs__pane { display: flex; flex-direction: column; gap: 2px; }
.minitabs__pane--suggest { padding: 12px 10px 14px; gap: 12px; align-items: flex-start; }
.minitabs__pane--suggest p { color: var(--text-2); font-size: .9rem; }
.news-panel .minitabs__pane--suggest a { width: auto; }
@media (max-width: 420px) { .news-panel .minitabs__tab .icon { display: none; } }

/* Language switcher ------------------------------------------------------------------------------------------ */
.lang { display: inline-flex; padding: 3px; gap: 2px; background: var(--panel-deep); border: 1px solid var(--border); border-radius: 99px; }
.lang__item { min-width: 38px; padding: 5px 10px; border-radius: 99px; text-align: center; text-decoration: none; color: var(--text-2); font: 600 .75rem/1.2 var(--font-mono); letter-spacing: .06em; }
.lang__item:hover { color: var(--text); }
.lang__item.is-active { background: var(--violet); color: #0B0F1E; }
.sidebar__lang { display: none; margin-bottom: 14px; }
.authbox > .lang { align-self: center; }

/* Misc ------------------------------------------------------------------------------------------------------ */
.link { color: var(--pink); }
.link--small { font-size: .85rem; }
.divider { border: 0; border-top: 1px solid var(--border-subtle); margin: 22px 0; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 48px 20px; background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius-l); color: var(--text-2); }
.empty .icon { color: var(--violet); }
.empty h2, .empty__h1 { color: var(--text); font-family: var(--font-display); font-size: 1.3rem; }
.empty__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.empty .btn { margin-top: 8px; }
.empty-filter { text-align: center; color: var(--text-2); padding: 24px; }
.lead { font-size: 1.05rem; color: var(--text-2); max-width: 70ch; }
.searchbar { display: flex; align-items: center; gap: 10px; }
.searchbar > .icon { color: var(--text-2); position: absolute; margin-left: 14px; pointer-events: none; }
.searchbar .input { padding-left: 42px; }
.searchbar--inline { position: relative; min-width: 240px; flex: 1; max-width: 340px; }
.searchbar--inline .input { min-height: 38px; }
