/* ==========================================================================
   koharycraft.xyz - same monochrome look as the KoharyCraft launcher
   (colours, 3D buttons and the "KC Pixel" font are shared with it)
   ========================================================================== */

@font-face {
  font-family: 'KC Pixel';
  src: url('/fonts/kc-pixel-400.woff2') format('woff2');
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: 'KC Pixel';
  src: url('/fonts/kc-pixel-700.woff2') format('woff2');
  font-weight: 700;
  font-display: block;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root,
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b0b0c;
  --bg-raised: #111113;
  --surface: #141416;
  --surface-2: #19191c;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #66666e;

  --btn-bg: rgba(255, 255, 255, 0.05);
  --btn-bg-hover: rgba(255, 255, 255, 0.09);
  --btn-border: rgba(255, 255, 255, 0.13);
  --btn-border-top: rgba(255, 255, 255, 0.24);
  --btn-border-bottom: rgba(255, 255, 255, 0.05);

  --primary-bg: #f4f4f5;
  --primary-bg-hover: #ffffff;
  --primary-text: #0b0b0c;
  --primary-border: #d4d4d8;
  --primary-border-top: #ffffff;
  --primary-border-bottom: #8e8e96;

  --shadow-3d: 0 4px 0 rgba(0, 0, 0, 0.45), 0 8px 18px rgba(0, 0, 0, 0.4);
  --shadow-3d-hover: 0 6px 0 rgba(0, 0, 0, 0.45), 0 12px 24px rgba(0, 0, 0, 0.45);
  --shadow-3d-active: 0 1px 0 rgba(0, 0, 0, 0.45), 0 3px 8px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.6);

  --glow: rgba(255, 255, 255, 0.55);
  --line: rgba(255, 255, 255, 0.075);
  --spot: rgba(255, 255, 255, 0.06);
  --pattern: rgba(255, 255, 255, 0.08);
  --scrim: rgba(0, 0, 0, 0.6);
  --track: rgba(255, 255, 255, 0.08);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f3f2;
  --bg-raised: #fafafa;
  --surface: #ffffff;
  --surface-2: #f7f7f6;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.16);
  --text: #0b0b0c;
  --text-2: #52525b;
  --text-3: #8f8f97;

  --btn-bg: rgba(255, 255, 255, 0.7);
  --btn-bg-hover: #ffffff;
  --btn-border: rgba(0, 0, 0, 0.13);
  --btn-border-top: rgba(0, 0, 0, 0.08);
  --btn-border-bottom: rgba(0, 0, 0, 0.24);

  --primary-bg: #111113;
  --primary-bg-hover: #000000;
  --primary-text: #fafafa;
  --primary-border: #2a2a2e;
  --primary-border-top: #4a4a50;
  --primary-border-bottom: #000000;

  --shadow-3d: 0 4px 0 rgba(0, 0, 0, 0.1), 0 8px 18px rgba(0, 0, 0, 0.08);
  --shadow-3d-hover: 0 6px 0 rgba(0, 0, 0, 0.1), 0 12px 24px rgba(0, 0, 0, 0.1);
  --shadow-3d-active: 0 1px 0 rgba(0, 0, 0, 0.1), 0 3px 8px rgba(0, 0, 0, 0.08);
  --shadow-pop: 0 18px 50px rgba(0, 0, 0, 0.18);

  --glow: rgba(0, 0, 0, 0.35);
  --line: rgba(0, 0, 0, 0.075);
  --spot: rgba(255, 255, 255, 0.9);
  --pattern: rgba(0, 0, 0, 0.07);
  --scrim: rgba(243, 243, 242, 0.7);
  --track: rgba(0, 0, 0, 0.08);
}

:root {
  --font-pixel: 'KC Pixel', ui-monospace, monospace;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --radius: 6px;
  --radius-lg: 10px;
  --sidebar-w: 88px;
  --header-h: 72px;
  --panel-w: 340px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

body.ready {
  opacity: 1;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 1em;
  height: 1em;
  display: block;
  flex: none;
}

.mono {
  font-family: var(--font-mono);
}

.pixel {
  font-family: var(--font-pixel);
}

/* ---------- Shell: logo corner, top bar, sidebar ---------------------- */

.site {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 60% -10%, var(--spot), transparent 60%),
    var(--bg);
}

.corner {
  grid-row: 1;
  grid-column: 1;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.brand-logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  border: 2px solid var(--btn-border);
  border-top-color: var(--btn-border-top);
  border-bottom: 4px solid var(--btn-border-bottom);
  box-shadow: var(--shadow-3d);
  color: var(--text);
  text-decoration: none;
}

.logo {
  width: 24px;
  height: 28px;
}

.logo .logo-glyph {
  fill: currentColor;
}

.logo .logo-shadow {
  fill: var(--text-3);
  opacity: 0.7;
}

.topbar {
  grid-row: 1;
  grid-column: 2;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px 0 22px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
}

.brand {
  text-decoration: none;
}

.brand-name {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.brand-sub {
  margin-top: 5px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chip {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border-radius: var(--radius);
  background: var(--btn-bg);
  border: 2px solid var(--btn-border);
  border-top-color: var(--btn-border-top);
  border-bottom: 4px solid var(--btn-border-bottom);
  box-shadow: var(--shadow-3d);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    background 0.15s;
}

.chip:hover {
  background: var(--btn-bg-hover);
  transform: translateY(-1px);
}

.chip:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-3d-active);
}

.chip .icon {
  font-size: 16px;
}

.chip.account {
  padding-left: 6px;
}

.chip-text {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  image-rendering: pixelated;
  background: var(--surface-2);
}

.theme-btn {
  width: 38px;
  padding: 0;
  justify-content: center;
}

.sidebar {
  grid-row: 2;
  grid-column: 1;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 0 18px;
  border-right: 1px solid var(--border);
}

.sidebar-spacer {
  flex: 1;
}

.nav-btn {
  position: relative;
  width: 70px;
  padding: 9px 0 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  color: var(--text-3);
  border: 2px solid transparent;
  border-bottom-width: 4px;
  text-decoration: none;
  transition:
    transform 0.15s var(--ease),
    color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}

.nav-btn:hover {
  color: var(--text);
  transform: translateY(-2px);
}

.nav-btn.active {
  color: var(--text);
  background: var(--btn-bg);
  border-color: var(--btn-border);
  border-top-color: var(--btn-border-top);
  border-bottom-color: var(--btn-border-bottom);
  box-shadow: var(--shadow-3d);
}

.nav-icon {
  font-size: 26px;
}

.nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-right: -0.06em;
  text-transform: uppercase;
}

.content {
  grid-row: 2;
  grid-column: 2;
  min-width: 0;
  animation: view-in 0.35s var(--ease);
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Buttons, inputs, cards ----------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius);
  background: var(--btn-bg);
  border: 2px solid var(--btn-border);
  border-top-color: var(--btn-border-top);
  border-bottom: 4px solid var(--btn-border-bottom);
  box-shadow: var(--shadow-3d);
  font-weight: 650;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    background 0.15s,
    opacity 0.15s;
}

.btn .icon {
  font-size: 16px;
}

.btn:hover:not(:disabled) {
  background: var(--btn-bg-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-3d-hover);
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: var(--shadow-3d-active);
}

.btn:disabled {
  opacity: 0.45;
}

.btn-sm {
  height: 36px;
  padding: 0 12px;
  border-bottom-width: 3px;
}

.btn-primary {
  background: var(--primary-bg);
  color: var(--primary-text);
  border-color: var(--primary-border);
  border-top-color: var(--primary-border-top);
  border-bottom-color: var(--primary-border-bottom);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-bg-hover);
}

.btn.working .btn-label {
  animation: blink 1s steps(2) infinite;
}

/* The big "launch" style button from the launcher. */
.btn-hero {
  min-width: 300px;
  height: 74px;
  border-radius: 8px;
  flex-direction: column;
  gap: 7px;
}

.btn-hero .hero-title {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.btn-hero .hero-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--text-3);
  font-size: 16px;
  transition:
    color 0.15s,
    background 0.15s;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--btn-bg-hover);
}

.input {
  height: 44px;
  width: 100%;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  outline: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.15s;
}

.input:focus {
  border-color: var(--text);
}

.input.invalid {
  border-color: var(--text);
  border-style: dashed;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field-hint {
  color: var(--text-3);
  font-size: 11.5px;
}

.field-hint.ok {
  color: var(--text-2);
}

.field-hint.error {
  color: var(--text);
  font-weight: 600;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap .input {
  padding-right: 46px;
}

.password-wrap .icon-btn {
  position: absolute;
  right: 7px;
  top: 6px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
}

.checkbox input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  flex: none;
  border-radius: 4px;
  border: 2px solid var(--btn-border);
  background: var(--track);
  cursor: pointer;
}

.checkbox input:checked {
  background: var(--text);
  border-color: var(--text);
  box-shadow: inset 0 0 0 3px var(--bg);
}

.card {
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
  border: 2px solid var(--btn-border);
  border-top-color: var(--btn-border-top);
  border-bottom: 4px solid var(--btn-border-bottom);
  box-shadow: var(--shadow-3d);
}

.card + .card {
  margin-top: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
}

.card-title .icon {
  font-size: 20px;
  color: var(--text-2);
}

.card-text {
  margin: 0;
  color: var(--text-2);
}

.card-text + .card-text {
  margin-top: 8px;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-pixel);
  font-size: 16px;
  line-height: 1;
  text-transform: uppercase;
}

.panel-title .icon {
  font-size: 18px;
  color: var(--text-2);
}

.stat-label {
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-value {
  font-weight: 650;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--border);
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.badge {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--text);
  color: var(--bg);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge.hollow {
  background: transparent;
  color: var(--text-2);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.text-link {
  color: var(--text);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

.text-link:hover {
  text-decoration-color: var(--text);
}

.form-error,
.form-ok {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
}

.form-error {
  background: var(--text);
  color: var(--bg);
}

.form-ok {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}

.code-input {
  height: 64px;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 12px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 13px;
}

.copy-row span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Page layouts --------------------------------------------- */

.page {
  max-width: 920px;
  padding: 30px 32px 60px;
}

.page-head {
  margin-bottom: 22px;
}

.page-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.05;
  text-transform: uppercase;
}

.page-sub {
  margin: 10px 0 0;
  color: var(--text-2);
  max-width: 620px;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.columns > .card + .card {
  margin-top: 0;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.steps li {
  position: relative;
  min-height: 26px;
  padding-left: 40px;
  color: var(--text-2);
  counter-increment: step;
}

.steps li strong {
  color: var(--text);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--surface-2);
  border: 2px solid var(--btn-border);
  border-bottom-width: 3px;
  color: var(--text);
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 13px;
}

/* Centered card pages: log in, register, password reset */
.auth {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: 40px 20px;
  overflow: hidden;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 28px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 2px solid var(--btn-border);
  border-top-color: var(--btn-border-top);
  border-bottom: 5px solid var(--btn-border-bottom);
  box-shadow: var(--shadow-pop);
  animation: modal-in 0.35s var(--ease);
}

.auth-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  border: 2px solid var(--btn-border);
  border-top-color: var(--btn-border-top);
  border-bottom: 4px solid var(--btn-border-bottom);
  font-size: 28px;
}

.auth-icon .logo {
  width: 26px;
  height: 30px;
}

.auth-title {
  margin: 4px 0 0;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.05;
  text-transform: uppercase;
}

.auth-sub {
  margin: -4px 0 4px;
  color: var(--text-2);
}

.auth-submit {
  height: 54px;
  margin-top: 4px;
}

.auth-submit .btn-label {
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 12.5px;
}

/* ---------- Home and account pages: 3D player stage + side panel ------- */

.split {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

.stage {
  position: sticky;
  top: var(--header-h);
  align-self: flex-start;
  height: calc(100vh - var(--header-h));
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.bg-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage-spot {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 560px;
  height: 560px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--spot), transparent);
  pointer-events: none;
}

.player {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 28px;
}

.nametag {
  font-family: var(--font-pixel);
  font-size: 16px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  padding: 7px 10px 6px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.skin-wrap {
  flex: 1;
  min-height: 300px;
  width: min(100%, 420px);
  margin-top: 4px;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.skin-wrap.loaded {
  opacity: 1;
}

.skin-wrap:active {
  cursor: grabbing;
}

.skin-wrap canvas {
  display: block;
}

.hero-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: -40px;
  padding: 0 20px 34px;
  text-align: center;
}

.hero-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-note {
  color: var(--text-2);
  font-size: 12px;
}

.side-panel {
  width: var(--panel-w);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 18px 30px;
  border-left: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-raised) 55%, transparent);
}

.side-panel .panel-title:not(:first-child) {
  margin-top: 12px;
}

.side-panel .card {
  padding: 14px;
}

.side-panel .card + .card {
  margin-top: 0;
}

.server-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-icon {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.server-icon .logo {
  width: 20px;
  height: 24px;
}

.server-name {
  font-weight: 700;
  font-size: 14px;
}

.server-address {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
}

/* ---------- Modal and toasts (same as the launcher) ------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--scrim);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s var(--ease);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 2px solid var(--btn-border);
  border-top-color: var(--btn-border-top);
  border-bottom: 5px solid var(--btn-border-bottom);
  box-shadow: var(--shadow-pop);
  animation: modal-in 0.25s var(--ease);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.modal-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 2px solid var(--btn-border);
  border-bottom-width: 4px;
  font-size: 28px;
}

.modal-title {
  margin: 0;
  font-family: var(--font-pixel);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.1;
  text-transform: uppercase;
}

.modal-text {
  margin: 10px 0 0;
  color: var(--text-2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-pop);
  font-size: 13px;
  pointer-events: auto;
  animation: toast-in 0.25s var(--ease);
}

.toast .icon {
  font-size: 18px;
  margin-top: 1px;
}

.toast.error {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.toast.leaving {
  animation: toast-out 0.2s var(--ease) forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.footer {
  padding: 22px 32px 30px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 12px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- Phones and small windows --------------------------------- */

@media (max-width: 1000px) {
  .split {
    flex-direction: column;
  }

  .stage {
    position: relative;
    top: 0;
    align-self: stretch;
    height: auto;
    min-height: 560px;
  }

  .side-panel {
    width: auto;
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --header-h: 60px;
  }

  .site {
    grid-template-columns: 1fr;
    padding-bottom: 76px;
  }

  .corner {
    display: none;
  }

  .topbar {
    grid-column: 1;
    padding: 0 12px;
  }

  .brand-sub,
  .chip-label {
    display: none;
  }

  .content {
    grid-column: 1;
  }

  .sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
  }

  .sidebar-spacer {
    display: none;
  }

  .page {
    padding: 22px 16px 40px;
  }

  .page-title {
    font-size: 23px;
  }

  .btn-hero {
    min-width: 0;
    width: 100%;
  }

  .hero-row {
    width: 100%;
    flex-direction: column;
  }

  .player {
    min-height: 340px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Account page --------------------------------------------- */

.account-split {
  --panel-w: 460px;
}

.account-split .card > * + * {
  margin-top: 14px;
}

.account-split .card-actions {
  margin-top: 14px;
}

#bedrockForm,
#bedrockLinked {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#bedrockForm[hidden],
#bedrockLinked[hidden] {
  display: none;
}

.steps-tight {
  gap: 10px;
  font-size: 13px;
}

.mt-14 {
  margin-top: 14px;
}

.mt-16 {
  margin-top: 16px;
}

.download-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.code-input::placeholder {
  color: var(--text-3);
  opacity: 0.45;
}

.auth-alt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12.5px;
}

.auth-alt .icon {
  font-size: 18px;
  color: var(--text-3);
}

/* ---------- Admin panel -------------------------------------------------- */

.page-wide {
  max-width: 1240px;
}

.admin-stats {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.admin-stats .stat-value {
  font-family: var(--font-pixel);
  font-size: 22px;
  font-weight: 700;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 22px 0 14px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 5px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    background 0.15s,
    color 0.15s;
}

.segmented button .icon {
  font-size: 15px;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.active {
  background: var(--primary-bg);
  color: var(--primary-text);
}

.admin-search {
  width: min(360px, 100%);
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 12px 14px;
  text-align: left;
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table td.mono {
  font-size: 12px;
  color: var(--text-2);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tr.clickable {
  cursor: pointer;
}

.table tbody tr:hover {
  background: var(--btn-bg);
}

.table-empty {
  text-align: center;
  color: var(--text-3);
  padding: 30px 14px !important;
}

.cell-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
}

.cell-actions {
  text-align: right;
  white-space: nowrap;
}

.cell-actions .btn + .btn {
  margin-left: 6px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.pager-info {
  margin-right: auto;
  color: var(--text-3);
  font-size: 12px;
}

.flip-left .icon {
  transform: rotate(90deg);
}

.flip-right .icon {
  transform: rotate(-90deg);
}

.modal.wide {
  width: min(680px, 100%);
}

.user-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 6px;
}

.user-badges {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fact-wide {
  grid-column: 1 / -1;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

select.input {
  appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
