:root {
  --bg:      #111113;
  --surface: #1c1c1f;
  --card:    #222226;
  --text:    #f0f0f0;
  --muted:   #6e6e78;
  --accent:  #ff7a00;
  --border:  rgba(255,255,255,.08);
  --shadow:  0 8px 28px rgba(0,0,0,.45);
  --radius:  16px;
}

* { box-sizing: border-box }
html, body { height: 100% }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Shell ─────────────────────────────────────────── */
.app-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Content ─────────────────────────────────────────── */
.content {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}
.has-tabs .content {
  padding-bottom: 96px;
}

/* ── Card ─────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  box-shadow: var(--shadow);
}
.card--auth { max-width: 520px; margin: 0 auto }

/* ── Typography ─────────────────────────────────────── */
.h1   { font-size: 22px; margin: 0 0 10px; color: var(--text) }
.muted { color: var(--muted); margin: 0 0 14px; line-height: 1.5 }

/* ── Form ─────────────────────────────────────────── */
.form  { display: flex; flex-direction: column; gap: 14px }
.field { display: flex; flex-direction: column; gap: 6px }
.field__label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em }

/* Shared style for action-modal inputs/selects/textareas */
.form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s;
  box-sizing: border-box;
}
.form-input:focus { border-color: var(--accent, #3b82f6); }
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e78' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}
select.form-input option {
  background: var(--surface);
  color: var(--text);
}

.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted) }
.input:focus {
  border-color: rgba(255,122,0,.6);
  box-shadow: 0 0 0 4px rgba(255,122,0,.14);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 14px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: opacity .15s;
}
.btn:active { opacity: .75 }
.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}
.btn--outline {
  background: transparent;
  border-color: rgba(255,122,0,.45);
  color: var(--text);
}
.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: 14px;
  padding: 8px 10px;
}
.btn--block { width: 100% }

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

/* ── Flash messages ─────────────────────────────────── */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px }
.flash {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
}
.flash--error   { border-color: rgba(255,80,80,.4);  color: #ff8080 }
.flash--success { border-color: rgba(255,122,0,.4);  color: var(--accent) }

/* ── Tab Bar ─────────────────────────────────────────── */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 76px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 6px 10px;
  z-index: 50;
}

.tab {
  text-decoration: none;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 14px;
  transition: color .15s, background .15s;
}
.tab__icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tab__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}
.tab__label { font-size: 11px; font-weight: 700 }

.tab--active {
  color: var(--accent);
  background: rgba(255,122,0,.10);
}

/* ── Profile ─────────────────────────────────────────── */
.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}
.profile-header__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.id-chip {
  display: inline-block;
  padding: 4px 12px;
  margin-left: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,122,0,.35);
  background: rgba(255,122,0,.12);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .06em;
}

/* ── Grid ─────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

/* ── Section spacing ─────────────────────────────── */
.section-gap { margin-top: 14px }

/* ── Role badge ──────────────────────────────────── */
.profile-role-row { margin-top: 10px }
.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
  border: 1px solid transparent;
}
.role-badge--player {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.12);
  color: var(--muted);
}
.role-badge--admin {
  background: rgba(255,122,0,.15);
  border-color: rgba(255,122,0,.35);
  color: var(--accent);
}
.role-badge--author {
  background: rgba(100,180,255,.12);
  border-color: rgba(100,180,255,.3);
  color: #64b4ff;
}

/* ── Tab Bar: variable tab counts ───────────────── */
.tabbar--4 { grid-template-columns: repeat(4, 1fr) }
.tabbar--5 { grid-template-columns: repeat(5, 1fr) }
.tabbar--6 { grid-template-columns: repeat(6, 1fr) }
.tabbar--7 { grid-template-columns: repeat(7, 1fr) }

/* Compact tabs for 6-7 items */
.tabbar--6 .tab__icon,
.tabbar--7 .tab__icon { width: 22px; height: 22px; }
.tabbar--6 .tab__icon svg,
.tabbar--7 .tab__icon svg { width: 18px; height: 18px; }
.tabbar--6 .tab__label,
.tabbar--7 .tab__label { font-size: 9px; }
.tabbar--7 { padding: 6px 2px 10px; gap: 0; }

/* ── Page header (title + action button) ────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.page-header .h1 { margin: 0 }

/* ── Game cards ──────────────────────────────────── */
.game-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.game-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.game-card__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.game-card__meta-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.game-card__meta-row svg { flex-shrink: 0; opacity: .7 }

.game-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.game-card--link:hover,
.game-card--link:active {
  border-color: rgba(255,122,0,.4);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
}

.game-card--with-actions {
  position: relative;
  padding-bottom: 44px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.game-card--with-actions:hover {
  border-color: rgba(255,122,0,.4);
}
.game-card--with-actions:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0,0,0,.55);
}
.game-card__status {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  border: 1px solid;
}
.game-card__status--announce {
  background: rgba(34, 197, 94, .15);
  border-color: rgba(34, 197, 94, .4);
  color: #4ade80;
}
.game-card__status--archive {
  background: rgba(255, 122, 0, .15);
  border-color: rgba(255, 122, 0, .4);
  color: var(--accent);
}
.game-card__status--draft {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .12);
  color: var(--muted);
}
.game-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.game-card__link:hover .game-card__title { color: var(--accent) }
.game-card__delete {
  position: absolute;
  bottom: 10px;
  right: 10px;
  margin: 0;
}

/* ── Create game form ────────────────────────────── */
.cg-section { margin-bottom: 14px }

.cg-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.cg-row:last-child { margin-bottom: 0 }
.cg-row__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.cg-row__body--inline {
  display: flex;
  gap: 10px;
}
.cg-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.cg-add-row .input { flex: 1 }
.cg-field-error {
  font-size: 13px;
  color: #ff6060;
  margin-top: 4px;
}

/* File upload */
.file-upload {
  display: block;
  border: 2px dashed var(--border);
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s;
}
.file-upload:hover { border-color: rgba(255,122,0,.45) }
.file-upload__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}
.file-upload__placeholder svg { opacity: .5 }

/* Announce image block — 9:12 ratio */
.announce-upload {
  display: block;
  position: relative;
  width: 100%;
  max-width: 270px;
  aspect-ratio: 9 / 12;
  border: 2px dashed var(--border);
  border-radius: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s;
  background: var(--card);
}
.announce-upload:hover { border-color: rgba(255,122,0,.45) }
.announce-upload__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}
.announce-upload__placeholder svg { opacity: .5 }
.announce-upload img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* Author chips */
#authors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.author-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(255,122,0,.1);
  border: 1px solid rgba(255,122,0,.25);
  border-radius: 999px;
  font-size: 13px;
}
.author-chip__name { font-weight: 600; color: var(--text) }
.author-chip__id   { color: var(--muted); font-size: 12px }
.author-chip__lead { color: var(--accent); font-size: 14px; margin-right: 2px; line-height: 1 }

/* Task blocks */
.task-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .15s;
}
.task-block__header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 10px 10px 4px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.task-block--collapsed .task-block__header { border-bottom: none; }
.task-block__drag {
  cursor: grab;
  color: var(--muted);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  touch-action: none;
}
.task-block__drag:active { cursor: grabbing; }
.task-block__drag svg { display: block; }
.task-block__drag--holding {
  color: var(--accent,#ff7a00);
  animation: drag-hold-pulse .7s ease-out forwards;
}
.task-block__drag--armed { color: var(--accent,#ff7a00); cursor: grabbing; }
@keyframes drag-hold-pulse {
  0%   { transform: scale(1); }
  60%  { transform: scale(1.25); }
  100% { transform: scale(1.1); }
}
.task-block__num {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  flex-shrink: 0;
}
.task-block__preview {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 4px;
  opacity: 0;
  pointer-events: none;
}
.task-block--collapsed .task-block__preview { opacity: 1; }
.task-block__collapse-btn { flex-shrink: 0; }
.task-block__collapse-btn svg { transition: transform .2s; display: block; }
.task-block--collapsed .task-block__collapse-btn svg { transform: rotate(-90deg); }
.task-block__body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.task-block--collapsed .task-block__body { display: none; }

/* Drag states */
.task-block--dragging { opacity: .35; }
.task-block--drag-over-before { border-top: 3px solid var(--accent); border-radius: 14px; }
.task-block--drag-over-after  { border-bottom: 3px solid var(--accent); }
.task-drag-placeholder {
  border: 2px dashed var(--accent,#ff7a00);
  border-radius: 14px;
  background: rgba(255,122,0,.06);
  margin-bottom: 12px;
}

/* Select styled like input */
.select-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236e6e78' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Textarea */
.textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}

/* Codes */
.codes-list { display: flex; flex-direction: column; gap: 8px }
.code-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.code-row__label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 52px;
}
.code-row .input { flex: 1 }

/* Code groups with variants ─────────────────────── */
.code-group {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 10px 12px 8px;
  margin-bottom: 8px;
}
.code-group__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.code-group__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.code-variants {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.code-variant-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.code-variant-row .input { flex: 1 }
.btn--ghost {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 12px;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: 6px;
}
.btn--ghost:hover { background: rgba(255,122,0,.1) }
.btn--xs { font-size: 12px; padding: 3px 8px }

/* Action bar (create/edit game) ─────────────────── */
.cg-action-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 10px;
  padding: 8px 0;
  background: var(--bg);
  margin-bottom: 8px;
}
.cg-action-bar__save { flex: 1 }
.cg-action-bar__exit { flex: 1; text-align: center }

/* player fullname in admin */
.player-fullname {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 3px;
}
.team-link, .player-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255,255,255,.25);
  transition: color .15s, border-color .15s;
}
.team-link:hover, .player-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Publish bar ───────────────────────────────────── */
.publish-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 12px;
}
.publish-bar__engine-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.publish-bar__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.publish-bar__status--on  { color: #4caf50 }
.publish-bar__status--off { color: var(--muted) }
.publish-bar__status--archived { color: var(--accent) }
.publish-bar__status--engine-on { color: #4caf50 }
.publish-bar__divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Announce cards ────────────────────────────────── */
.announce-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}
.announce-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.announce-card__cover {
  width: 100%;
  background: var(--surface);
  display: flex;
  justify-content: center;
}
.announce-card__cover img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}
.announce-card__cover--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.announce-card__body {
  padding: 10px 14px 14px;
}
.announce-card__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent);
  text-align: center;
  line-height: 1.25;
}
.announce-engine-btn {
  display: block;
  width: 100%;
  padding: 10px 20px;
  font-size: 15px;
  text-align: center;
  text-decoration: none;
  margin-bottom: 12px;
}
.announce-card__meta-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 3px;
}
.announce-card__meta-label {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.announce-card__teams {
  margin-top: 10px;
}
.announce-card__teams-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.announce-card__team-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--text);
}
.announce-card__team-num {
  color: var(--muted);
  min-width: 18px;
  font-size: 12px;
}
.announce-card__team-name { flex: 1 }
.announce-card__team-chip {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  background: rgba(255,255,255,.04);
}
.btn--danger-outline {
  border-color: rgba(229,57,53,.5);
  color: #ef5350;
}
.btn--danger-outline:hover { background: rgba(229,57,53,.1) }

/* Admin: player list ────────────────────────────── */
.player-list { display: flex; flex-direction: column }

.player-row { padding: 10px 0 }
.player-divider { height: 1px; background: var(--border) }

.player-view {
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-edit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.player-info { flex: 1; min-width: 0 }
.player-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-sub  { font-size: 12px; color: var(--muted); margin-top: 2px }
.no-name     { opacity: .4; font-style: italic }

.player-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.player-right--edit { gap: 6px }

.btn--ghost-muted {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 6px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn--ghost-muted:hover { color: var(--text); background: rgba(255,255,255,.06) }

/* ── Select role ─────────────────────────────────── */
.select-role {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 150px;
}
.select-role:focus {
  border-color: rgba(255,122,0,.5);
  box-shadow: 0 0 0 3px rgba(255,122,0,.12);
}

/* ── Admin edit rows ─────────────────────────────── */
.admin-edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}
.admin-edit-row .input--sm {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  height: 34px;
  padding: 5px 10px;
  font-size: 13px;
  box-sizing: border-box;
}
.admin-edit-row .select-role {
  max-width: 100%;
  box-sizing: border-box;
}

/* ── Profile display (view mode) ─────────────────── */
.profile-display-login {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .02em;
  margin-bottom: 2px;
}
.profile-divider {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 8px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.profile-display-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  min-height: 28px;
}
.profile-display-phone {
  font-size: 15px;
  color: var(--muted);
  margin-top: 6px;
}
.profile-display-phone--empty {
  font-style: italic;
  opacity: .6;
}

/* ── Typography extras ───────────────────────────── */
.h2 { font-size: 17px; font-weight: 700; margin: 0 0 12px; color: var(--text) }
.h3 { font-size: 14px; font-weight: 700; margin: 0 0 10px; color: var(--muted) }

/* ── Divider ─────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge--captain {
  background: rgba(255,122,0,.18);
  color: var(--accent);
  border: 1px solid rgba(255,122,0,.3);
}

/* ── id-chip small variant ───────────────────────── */
.id-chip--sm {
  font-size: 12px;
  padding: 2px 8px;
  margin-left: 4px;
}

/* ── Team header ─────────────────────────────────── */
.team-disband-btn { flex-shrink: 0 }
.team-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.team-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Member list ─────────────────────────────────── */
.member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,122,0,.18);
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.member-info { flex: 1; min-width: 0 }
.member-name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.member-id { font-size: 12px; color: var(--muted); margin-top: 2px }
.badge--captain {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,122,0,.18);
  color: var(--accent);
  border: 1px solid rgba(255,122,0,.35);
  white-space: nowrap;
}
.player-divider {
  height: 1px;
  background: var(--border);
  margin: 0 4px;
}

/* ── Invite row ──────────────────────────────────── */
.invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid rgba(255,122,0,.2);
  margin-bottom: 8px;
}
.invite-team {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.invite-from {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.invite-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Button extras ───────────────────────────────── */
.btn--sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
}
.btn--danger {
  background: rgba(255,60,60,.15);
  border-color: rgba(255,60,60,.35);
  color: #ff6060;
}
.btn--danger:active { opacity: .75 }
.btn--success {
  background: rgba(76,175,80,.18);
  border-color: rgba(76,175,80,.45);
  color: #66bb6a;
}
.btn--success:active { opacity: .75 }
.btn--icon {
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  line-height: 1;
}

/* ── Inline form row ─────────────────────────────── */
.form--row {
  flex-direction: row;
  align-items: stretch;
}
.form--row .input { flex: 1 }
.form--row .btn   { flex-shrink: 0 }

/* ── Archive list ────────────────────────────────────── */
.archive-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.archive-card {
  display: block;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.archive-card:hover {
  border-color: var(--accent);
  background: rgba(255,122,0,.06);
}
.archive-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.archive-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 13px;
  color: var(--muted);
}
.archive-card__authors {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Game view page ──────────────────────────────────── */
.gv-cover {
  border-radius: 0;
  width: 100%;
}
.gv-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.gv-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  font-size: 15px;
}
.gv-action-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* ── Chat page (Engine) — fullscreen, no tabbar ──────── */
.chat-page {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font, system-ui, sans-serif);
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Top bar — fixed to top */
.chat-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.chat-topbar--author {
  flex-direction: column;
  align-items: stretch;
  height: 104px;
  padding: 6px 10px 8px;
}
.chat-topbar__row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
.chat-topbar__row2 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chat-topbar__row2::-webkit-scrollbar { display: none; }
/* Engine actions dropdown */
.engine-actions-wrap {
  position: relative;
  flex-shrink: 0;
}
.engine-actions-menu {
  /* position/top/right set dynamically via JS for correct viewport placement */
  position: fixed;
  min-width: 240px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 300;
  overflow: hidden;
}
.engine-actions-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 16px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.engine-actions-menu__item:last-child { border-bottom: none; }
.engine-actions-menu__item:hover { background: rgba(255,255,255,.05); }
.engine-actions-menu__item--danger { color: #f87171 !important; }
.engine-actions-menu__item--danger:hover { background: rgba(248,113,113,.08) !important; }
.engine-actions-menu__divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}
.engine-actions-menu[hidden] { display: none !important; }
/* Action modal */
.action-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.action-modal-overlay[hidden] { display: none !important; }
.action-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 16px;
  width: min(340px, 92vw);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.action-modal__title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 14px;
}
.action-modal__footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}
.chat-topbar__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s;
}
.chat-topbar__back:hover { background: rgba(255,255,255,.08) }
.chat-topbar__game {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-topbar__task-btn {
  flex-shrink: 0;
  font-size: 12px;
  padding: 4px 12px;
  height: auto;
}
.chat-topbar__members-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  transition: background .15s;
}
.chat-topbar__members-btn:hover { background: rgba(255,255,255,.08) }
.chat-topbar__members-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}
.chat-topbar__clock {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 58px;
  text-align: right;
}

/* Members panel — slides from top below topbar */
.chat-members-panel {
  position: fixed;
  top: 52px; left: 0; right: 0;
  z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.chat-members-panel[hidden] { display: none }
.chat-members-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.chat-members-panel__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  padding: 2px;
}
.chat-members-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.chat-members-list__item {
  font-size: 14px;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.chat-members-list__item:last-child { border-bottom: none }

/* Messages area — fixed frame, rooms scroll inside */
.chat-messages {
  position: fixed;
  top: 52px;
  bottom: 64px;
  left: 0; right: 0;
  overflow: hidden;
}
.chat-page--author .chat-messages { top: 104px; }
.chat-page--author .chat-members-panel { top: 104px; }
/* Each room is a full-height scrollable column */
.chat-room-container {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-date-divider {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 10px;
}

/* Message row (incoming: avatar + bubble) */
.chat-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  align-self: flex-start;
  max-width: 85%;
}
.chat-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.chat-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.chat-msg-row .chat-bubble--in {
  align-self: unset;
  max-width: none;
}

/* Bubbles */
.chat-bubble {
  max-width: 75%;
  padding: 8px 12px 4px;
  border-radius: 16px;
  word-break: break-word;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-bubble--in {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-bubble--out {
  align-self: flex-end;
  background: rgba(255,122,0,.18);
  border: 1px solid rgba(255,122,0,.3);
  border-bottom-right-radius: 4px;
}
.chat-bubble__name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 3px;
}
.chat-bubble__name {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
}
.chat-bubble__author-badge {
  display: inline-block;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  opacity: .9;
}
.chat-bubble__body {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.chat-bubble__text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
  flex: 1;
  min-width: 0;
}
.chat-bubble__time {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-bottom: 1px;
}

/* Input bar — fixed to bottom like TabBar */
.chat-input-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  min-height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.chat-emoji-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
  margin-bottom: 4px;
  transition: background .15s;
}
.chat-emoji-btn:hover { background: rgba(0,0,0,.06) }
.chat-emoji-picker-wrap {
  position: fixed;
  bottom: 72px;
  left: 8px;
  right: 8px;
  max-height: 320px;
  z-index: 99;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  overflow: hidden;
}
.chat-emoji-picker-wrap emoji-picker {
  --background: var(--surface);
  --num-columns: 8;
  width: 100%;
  height: 300px;
}
.chat-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--text);
  resize: none;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}
.chat-input:focus { border-color: var(--accent) }
.chat-input::placeholder { color: var(--muted) }
.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: background .15s, transform .1s;
  margin-bottom: 4px;
}
.chat-send-btn:hover  { background: #e06a00 }
.chat-send-btn:active { transform: scale(.93) }

/* System message in chat */
.chat-system-msg {
  align-self: center;
  max-width: 75%;
  background: rgba(255,122,0,.08);
  border: 1px solid rgba(255,122,0,.22);
  border-radius: 10px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-muted, #aaa);
  white-space: pre-wrap;
  text-align: center;
  margin: 1px 0 4px;
}
.chat-system-msg--done {
  font-size: 13px;
}

/* System image (task done / task fail) */
.chat-sys-img {
  display: block;
  align-self: center;
  width: 92%;
  max-width: 420px;
  border-radius: 14px;
  object-fit: contain;
  margin: 4px 0;
}

/* Task card in chat */
.chat-task-card {
  align-self: center;
  width: 92%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid rgba(255,122,0,.4);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px 10px;
  margin: 8px 0;
  font-size: 14px;
  color: var(--text);
}
.chat-task-card__header {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.chat-task-card__type {
  color: var(--accent);
}
.chat-task-card__text {
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.5;
  margin-bottom: 10px;
}
.chat-task-card__text a.chat-task-card__link {
  color: var(--accent);
  text-decoration: underline;
}
.chat-task-card__text a.chat-task-card__link:hover {
  text-decoration: none;
}
.chat-task-card__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}
.chat-task-card__meta {
  margin: 4px 0;
  font-size: 13px;
}
.chat-task-card__meta-label {
  color: var(--text-muted, #888);
}
.chat-task-card__meta-value {
  color: var(--accent);
  font-weight: 500;
}
.chat-task-card__from-orgs {
  margin-top: 4px;
  font-size: 13px;
}
.chat-task-card__cutoff-note {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(99, 102, 241, .12);
  border-left: 3px solid #6366f1;
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  color: #a5b4fc;
  line-height: 1.4;
}
.chat-task-card__from-orgs-label {
  color: var(--text-muted, #aaa);
}
.chat-task-card__from-orgs-value {
  color: #e05555;
  font-weight: 500;
  white-space: pre-wrap;
}

/* Task card media */
.chat-task-card-wrap {
  align-self: center;
  width: 92%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
}
.chat-task-card-wrap__img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  display: block;
}
.chat-task-card-wrap .chat-task-card {
  align-self: unset;
  width: 100%;
  max-width: none;
  border-radius: 0 0 12px 12px;
  border-top: none;
}
.chat-task-card--has-img {
  border-top: none !important;
  border-radius: 0 0 12px 12px !important;
}
.chat-task-card__files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.chat-task-card__file-img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  background: rgba(0,0,0,.2);
}
.chat-task-card__file-video {
  width: 100%;
  max-height: 260px;
  border-radius: 10px;
  display: block;
  background: #000;
}
.chat-task-card__file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255,255,255,.07);
  border-radius: 8px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  word-break: break-all;
}
/* Telegram-style audio player */
.tg-audio {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.07);
  border-radius: 24px;
  padding: 8px 14px;
}
.tg-audio__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.tg-audio__btn:hover { opacity: .85; }
.tg-audio__progress {
  flex: 1;
  cursor: pointer;
  padding: 10px 0;
}
.tg-audio__bar {
  height: 3px;
  background: rgba(255,255,255,.25);
  border-radius: 2px;
  position: relative;
}
.tg-audio__fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .1s linear;
}
.tg-audio__time {
  font-size: 12px;
  color: var(--muted);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* System message quote (original text) */
.chat-system-msg__quote {
  font-size: 10px;
  color: var(--text-muted, #888);
  margin-bottom: 3px;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

/* Task text button in topbar */
.chat-topbar__task-text-btn {
  padding: 4px 10px;
  font-size: 13px;
}

/* Engine closed screen */
.chat-closed {
  position: fixed;
  top: 52px; bottom: 0; left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}
.chat-closed__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.chat-closed__sub {
  font-size: 14px;
}

/* Room list item — clickable */
.chat-room-item {
  cursor: pointer;
  transition: color .15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.chat-room-item:hover { color: var(--accent) }
.chat-room-item__progress {
  color: var(--accent);
  font-size: 13px;
  flex-shrink: 0;
}
.chat-room-item--unread {
  color: var(--accent);
  font-weight: 700;
}
.chat-room-item--unread::after {
  content: ' ●';
  font-size: 8px;
  vertical-align: middle;
}

/* ── Desktop ─────────────────────────────────────────── */
@media (min-width: 768px) {
  .has-tabs .content { padding-bottom: 100px }
  .tabbar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 18px;
    width: calc(100% - 48px);
    max-width: 980px;
    height: 64px;
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .grid { grid-template-columns: 1fr 1fr }
}

/* ── Universal avatar circle ─────────────────────────── */
.uavatar {
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.uavatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.uavatar--init {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* ── Avatar crop overlay ─────────────────────────────── */
.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: #111;
  display: flex;
  flex-direction: column;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.crop-area {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: grab;
}
.crop-area:active { cursor: grabbing; }
.crop-img-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.crop-img {
  display: block;
  transform-origin: center center;
  max-width: none;
  max-height: none;
}
.crop-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.crop-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55);
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.crop-bottom {
  background: #1a1a1a;
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 14px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.crop-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.crop-zoom-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.crop-zoom-btn:active { background: rgba(255,255,255,.2); }
.crop-zoom-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
}
.crop-btn-row {
  display: flex;
  gap: 10px;
}
.crop-btn-row .btn { flex: 1; }

/* Profile avatar edit button */
.profile-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  margin-bottom: 12px;
}
.profile-avatar-edit {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
}
