html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.dashboard {
  height: 100svh;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr) 300px;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.coins-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
}

.coins-icon {
  font-size: 10px;
}

#settingsButton {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

#settingsButton:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, .06);
}

#settingsButton .icon {
  width: 14px;
  height: 14px;
}

.top-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 10px;
}

.bottom-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 10px;
}

.hero-shell {
  position: relative;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  overflow: hidden;
}

.hero-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: opacity .4s ease, transform .6s ease;
  transform: scale(1.01);
}

.hero-image.nexting {
  opacity: .3;
  transform: scale(1.03);
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, .92) 0%, rgba(10, 10, 10, .4) 50%, rgba(10, 10, 10, .5) 100%),
    linear-gradient(0deg, rgba(10, 10, 10, .7) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 300px;
  display: grid;
  align-content: end;
  gap: 18px;
  padding: 24px;
  max-width: 500px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -.03em;
  color: #e8e8e8;
}

.hero-copy {
  color: var(--muted);
  margin: 12px 0 0;
  max-width: 380px;
  line-height: 1.5;
  font-size: 14px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding-left: 20px;
}

.hero-dot {
  width: 5px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
}

.hero-dot.active {
  background: #999;
}

.account-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  overflow: visible;
}

.account-card.menu-open {
  z-index: 50;
}

.account-button {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
}

.account-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-toggle {
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform .15s ease;
}

.account-card.menu-open .account-toggle {
  transform: rotate(180deg);
}

.account-toggle .icon {
  width: 14px;
  height: 14px;
}

.account-menu {
  position: absolute;
  top: 64px;
  right: 14px;
  width: calc(100% - 28px);
  z-index: 80;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel-2);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

.account-menu.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(255, 255, 255, .01);
}

.menu-profile strong,
.menu-profile small {
  display: block;
}

.menu-profile small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.menu-buttons {
  display: grid;
  gap: 4px;
}

.account-menu button {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-menu button:hover {
  background: rgba(255, 255, 255, .03);
}

.account-menu button.danger {
  color: var(--danger);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .06);
  background: var(--panel-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  flex: 0 0 auto;
}

.avatar.small {
  width: 28px;
  height: 28px;
}

.avatar .icon {
  width: 20px;
  height: 20px;
}

.avatar.small .icon {
  width: 14px;
  height: 14px;
}

.account-card h2 {
  margin: 0;
  font-size: 15px;
}

.account-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.rank-section {
  text-align: center;
  padding: 12px 0 14px;
  border-bottom: 1px solid;
  margin-bottom: 8px;
}

.rank-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rank-number {
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
}

.stats-list {
  display: grid;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-row span:first-child {
  color: var(--muted);
}

.stat-row span:last-child {
  font-weight: 600;
}

.empty-stats {
  color: var(--muted);
  line-height: 1.5;
  border: 1px dashed var(--line);
  border-radius: 3px;
  padding: 12px;
  font-size: 13px;
}

.match-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  padding: 14px;
  background: rgba(10, 10, 10, .6);
}

.match-overlay.show {
  display: grid;
}

.match-panel {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 10px;
  max-width: 600px;
}

.match-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.match-head h2 {
  margin: 0;
  font-size: 15px;
}

.lobby-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.private-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.available-list {
  display: grid;
  gap: 6px;
  align-content: start;
  overflow: auto;
  max-height: 100%;
}

.available-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(255, 255, 255, .01);
}

.available-row strong {
  display: block;
  font-size: 13px;
}

.available-row span {
  color: var(--muted);
  font-size: 11px;
}

.recent-section,
.friends-section {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  padding: 14px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-head h2 {
  margin: 0;
  font-size: 15px;
}

.recent-list {
  display: grid;
  gap: 4px;
  overflow: auto;
  max-height: 100%;
}

.games-table-header {
  display: grid;
  grid-template-columns: minmax(130px, 1.6fr) .55fr minmax(110px, 1fr) .75fr .55fr .7fr 34px;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 2px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--panel-2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.game-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.6fr) .55fr minmax(110px, 1fr) .75fr .55fr .7fr 34px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  height: 50px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(255, 255, 255, .01);
  font-size: 12px;
}

.game-row:hover {
  background: rgba(255, 255, 255, .02);
  border-color: rgba(255, 255, 255, .06);
}

.col {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.col-opponent {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}

.opponent-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opponent-rank {
  color: var(--muted);
  font-size: 10px;
}

.col-date,
.col-duration,
.col-shots {
  justify-content: flex-start;
}

.col-result,
.col-action {
  justify-content: flex-end;
}

.badge {
  font-weight: 600;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge.win {
  background: rgba(138, 176, 144, .15);
  color: var(--green);
}

.badge.loss {
  background: rgba(196, 123, 123, .15);
  color: var(--danger);
}

.icon-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: var(--panel-3);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 800;
}

.add-friend-btn {
  min-width: 104px;
  height: 28px;
  padding: 5px 11px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
}

.add-friend-btn span,
.add-friend-btn .add-friend-text,
.add-friend-btn .add-friend-plus {
  color: inherit;
  font-size: inherit;
  line-height: 1;
  margin: 0;
}

.add-friend-plus {
  position: relative;
  top: -1px;
  font-size: 14px !important;
  font-weight: 900;
}

.icon-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, .1);
}

.icon-btn:disabled,
.add-friend-btn:disabled {
  opacity: .38;
  cursor: not-allowed;
  filter: grayscale(.25);
}

.icon-btn.green:hover {
  color: var(--green);
  border-color: rgba(138, 176, 144, .3);
}

.icon-btn.danger:hover {
  color: var(--danger);
  border-color: rgba(196, 123, 123, .3);
}

.friends-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  overflow: hidden;
}

.add-friend-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.friend-block {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 5px;
}

.friend-block.compact {
  max-height: 76px;
}

.friend-block h3 {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.friends-list,
.requests-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  overflow: auto;
}

.friend-row,
.request-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  background: rgba(255, 255, 255, .01);
  cursor: pointer;
}

.friend-row:hover,
.request-row:hover {
  border-color: rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .02);
}

.friend-main,
.request-main {
  min-width: 0;
}

.friend-main strong,
.request-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.friend-main span,
.request-main span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 2px;
}

.friend-actions,
.request-actions {
  display: flex;
  gap: 5px;
}

.chat-bubble {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 80;
  width: min(360px, calc(100vw - 28px));
  height: 430px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
}

.chat-head strong,
.chat-head small {
  display: block;
}

.chat-head small {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding: 12px;
}

.chat-message {
  width: fit-content;
  max-width: 82%;
  justify-self: start;
  justify-items: start;
  display: grid;
  gap: 3px;
}

.chat-message.mine {
  justify-self: end;
  justify-items: end;
  margin-left: auto;
  text-align: right;
}

.chat-message:not(.mine) {
  margin-right: auto;
}

.chat-message p {
  width: fit-content;
  max-width: 100%;
  justify-self: start;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.chat-message.mine p {
  justify-self: end;
  background: var(--green-fill);
  border-color: var(--green-border);
  color: #d8ead9;
}

.chat-message small {
  width: fit-content;
  justify-self: start;
  color: var(--muted);
  font-size: 9px;
}

.chat-message.mine small {
  justify-self: end;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 10px;
}

.settings-modal {
  max-width: 380px;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.setting-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  padding: 12px;
}

.setting-row strong,
.setting-row small {
  display: block;
}

.setting-row small {
  color: var(--muted);
  margin-top: 2px;
  font-size: 11px;
}

.setting-control {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 8px;
  align-items: center;
}

.setting-control b {
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.custom-range {
  --value: 85%;
  width: 100%;
  height: 24px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.custom-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--panel-3);
}

.custom-range::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #666;
  margin-top: -5px;
}

.custom-range::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: var(--panel-3);
}

.custom-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #666;
  border: 0;
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .dashboard {
    height: auto;
    min-height: 100svh;
    grid-template-rows: 44px auto auto;
  }

  .top-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .hero-shell,
  .account-card,
  .recent-section,
  .friends-section {
    min-height: 280px;
  }

  .hero-content {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .dashboard {
    padding: 8px;
  }

  .hero-content {
    padding: 18px;
  }

  .private-row,
  .add-friend-row,
  .chat-form {
    grid-template-columns: 1fr;
  }

  .games-table-header {
    display: none;
  }

  .game-row {
    height: auto;
    grid-template-columns: 1fr 1fr;
  }

  .game-row > :last-child {
    grid-column: 1 / -1;
  }
}

/* Friends redesign follow-up */
.friends-head {
  gap: 8px;
}

.friends-panel {
  grid-template-rows: minmax(0, 1fr);
}

.friends-list {
  gap: 6px;
}

.friend-row.dimmed {
  opacity: .48;
}

.friend-row.active {
  opacity: 1;
  border-color: rgba(138, 176, 144, .22);
  background: rgba(138, 176, 144, .06);
}

.friend-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(138, 176, 144, .55);
}

.friend-request-row {
  border-color: rgba(196, 168, 107, .22);
  background: rgba(196, 168, 107, .05);
}

.chat-bubble {
  width: min(520px, calc(100vw - 28px));
  height: min(620px, calc(100svh - 28px));
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.chat-message.invite-message p {
  border-color: rgba(196, 168, 107, .22);
}

.copy-code-btn {
  justify-self: start;
  margin-top: 2px;
}

.chat-message.mine .copy-code-btn {
  justify-self: end;
}

.invite-modal {
  max-width: 420px;
}

.pending-invites {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.pending-invites h3 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.pending-invites .requests-list {
  max-height: 180px;
  overflow: auto;
}

@media (max-width: 560px) {
  .chat-head {
    align-items: stretch;
  }

  .chat-head-actions {
    flex-direction: column-reverse;
    align-items: end;
  }
}

/* Follow-up layout polish: sidebar, top wallet bar, settings page, tighter recent games. */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.app-shell {
  height: 100svh;
  min-height: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  min-height: 0;
  border-right: 1px solid var(--line-soft);
  background: #080808;
  padding: 8px 6px;
  display: grid;
  grid-auto-rows: max-content;
  gap: 5px;
  align-content: start;
}

.side-nav {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 7px 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.side-nav:hover,
.side-nav.active {
  color: var(--text);
  background: rgba(255, 255, 255, .025);
  border-color: rgba(255, 255, 255, .035);
}

.app-main {
  min-height: 0;
  display: grid;
  grid-template-rows: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 10px 10px 10px;
  overflow: hidden;
}

.dashboard-topbar {
  height: 28px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin: 0;
}

.top-currencies {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.resource-display,
.coins-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
}

.resource-display img {
  width: 21px;
  height: 21px;
  object-fit: contain;
  display: block;
}

.resource-value {
  min-width: 14px;
  text-align: right;
}

.top-separator {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, .08);
}

.dashboard-view {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 300px;
  gap: 10px;
  overflow: hidden;
}

.dashboard-view.hidden,
.settings-view.hidden {
  display: none !important;
}

.dashboard {
  display: none;
}

.top-grid,
.bottom-grid {
  min-height: 0;
}

.recent-section,
.friends-section {
  padding: 12px;
  grid-template-rows: max-content minmax(0, 1fr);
  gap: 0;
}

.section-head {
  height: 24px;
  min-height: 24px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.section-head h2 {
  font-size: 14px;
  line-height: 1;
}

.recent-list,
.friends-list,
.requests-list,
.available-list,
.chat-messages {
  align-content: start;
  grid-auto-rows: max-content;
}

.recent-list {
  gap: 5px;
  overflow: auto;
  padding-right: 2px;
}

.games-table-header,
.game-row {
  grid-template-columns: minmax(180px, 2fr) minmax(48px, .55fr) minmax(118px, 1fr) minmax(70px, .75fr) minmax(42px, .5fr) minmax(70px, .65fr) 28px;
  gap: clamp(7px, 1.5vw, 22px);
}

.games-table-header {
  height: 30px;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .045);
  background: rgba(255, 255, 255, .015);
}

.game-row {
  height: 46px;
  min-height: 46px;
  padding: 7px 10px;
  align-items: center;
}

.col-opponent {
  align-items: flex-start;
  text-align: left;
  justify-content: center;
}

.opponent-name {
  width: 100%;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.12;
  text-align: left;
}

.opponent-rank {
  width: 100%;
  font-size: 10px;
  text-align: left;
  margin-top: 2px;
}

.col-rank,
.col-date,
.col-duration,
.col-shots {
  justify-content: flex-start;
}

.col-result,
.col-action {
  justify-content: flex-end;
}

.badge {
  padding: 3px 7px;
}

.btn {
  border-color: rgba(255, 255, 255, .045);
}

.btn.primary,
.btn.green {
  border-color: rgba(138, 176, 144, .16);
}

.btn:hover {
  border-color: rgba(255, 255, 255, .075);
}

.btn.primary:hover,
.btn.green:hover {
  border-color: rgba(138, 176, 144, .24);
}

.account-static-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-view {
  min-height: 0;
  overflow: auto;
  padding: 34px 0 24px 34px;
}

.settings-panel-page {
  width: min(620px, 54vw);
  min-width: min(420px, calc(100vw - 96px));
  display: grid;
  gap: 20px;
}

.settings-page-head h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.settings-group {
  display: grid;
  gap: 8px;
}

.settings-group h2 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.account-settings-group {
  margin-top: 20px;
}

.setting-row.wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, auto);
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(255, 255, 255, .035);
  border-radius: 4px;
  background: rgba(255, 255, 255, .01);
  padding: 12px;
}

.setting-copy strong,
.setting-copy small {
  display: block;
}

.setting-copy strong {
  font-size: 13px;
}

.setting-copy small {
  color: var(--muted);
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.35;
}

.setting-control {
  display: grid;
  grid-template-columns: 170px 42px;
  gap: 10px;
  align-items: center;
  justify-content: end;
}

.setting-control.compact-actions {
  display: flex;
  justify-content: flex-end;
}

.setting-control b {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.custom-volume-slider {
  --value: 85%;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.custom-volume-slider:focus-visible .slider-rail {
  border-color: rgba(255, 255, 255, .12);
}

.slider-rail {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .035);
}

.slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--value);
  border-radius: inherit;
  background: rgba(138, 176, 144, .75);
}

.slider-thumb {
  position: absolute;
  left: var(--value);
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  background: #d4d4d4;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .035);
}

.danger-row {
  border-color: rgba(196, 123, 123, .08) !important;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .sidebar {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .side-nav {
    width: auto;
    padding: 7px 10px;
  }

  .app-main {
    padding: 8px;
  }

  .dashboard-view {
    height: auto;
    min-height: 100svh;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .settings-view {
    padding: 18px 0;
  }

  .settings-panel-page {
    width: 100%;
    min-width: 0;
  }

  .setting-row.wide,
  .setting-control {
    grid-template-columns: 1fr;
  }

  .setting-control {
    justify-content: stretch;
  }
}

/* Sidebar + recent-games header fix polish */
.app-shell {
  grid-template-columns: 122px minmax(0, 1fr);
}

.sidebar {
  position: relative;
  padding: 0;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), rgba(255,255,255,0) 32%),
    radial-gradient(circle at 50% 0%, rgba(255,255,255,.045), transparent 34%),
    #090a0b;
  border-right: 1px solid rgba(255, 255, 255, .045);
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, .55);
}

.sidebar-spacer {
  height: 36px;
  min-height: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, .012);
}

.side-nav {
  position: relative;
  height: 42px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(212, 212, 212, .56);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
  text-align: left;
}

.side-nav::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
}

.side-nav:hover {
  color: rgba(244, 244, 244, .86);
  background: rgba(255, 255, 255, .025);
  border-color: transparent;
}

.side-nav.active {
  color: #e5e5e5;
  background: linear-gradient(90deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  border-color: transparent;
}

.side-nav.active::before {
  background: var(--green);
  box-shadow: 0 0 10px rgba(138, 176, 144, .34);
}

.side-icon {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  color: rgba(212, 212, 212, .64);
  font-size: 15px;
  line-height: 1;
  font-weight: 400;
  flex: 0 0 auto;
}

.side-nav.active .side-icon,
.side-nav:hover .side-icon {
  color: rgba(245, 245, 245, .9);
}

.app-main {
  padding: 6px 18px 10px 10px;
}

.top-grid,
.bottom-grid {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.dashboard-topbar {
  padding-right: 6px;
}

.top-currencies {
  padding-right: 8px;
}

.recent-list {
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr);
  gap: 5px;
  overflow: hidden;
  max-height: none;
  min-height: 0;
  padding-right: 0;
}

.games-table-header {
  position: relative;
  top: auto;
  z-index: 2;
  height: 30px;
  min-height: 30px;
  background: var(--panel-2);
  border: 1px solid rgba(255,255,255,.035);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(0,0,0,.5);
}

.games-table-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 5px;
  padding-right: 2px;
}

.game-row {
  width: 100%;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 0;
  }

  .sidebar-spacer {
    display: none;
  }

  .side-nav {
    width: auto;
    height: 36px;
    padding: 0 14px;
  }

  .top-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* Refinement patch: flat sidebar, profile card, sliding hero, compact lobby row. */
.app-shell {
  grid-template-columns: 146px minmax(0, 1fr);
}

.sidebar {
  padding: 0;
  background: #090909;
  border-right: 1px solid rgba(255, 255, 255, .04);
  box-shadow: none;
}

.sidebar-spacer {
  height: 34px;
  min-height: 34px;
  border-bottom: 0;
  margin-bottom: 8px;
}

.side-nav {
  height: 44px;
  gap: 12px;
  padding: 0 20px;
  color: rgba(212, 212, 212, .55);
  background: transparent;
  border: 0;
}

.side-nav:hover {
  color: rgba(232, 232, 232, .88);
  background: rgba(255, 255, 255, .025);
}

.side-nav.active {
  color: rgba(232, 232, 232, .92);
  background: rgba(255, 255, 255, .04);
}

.side-nav.active::before {
  background: var(--green);
  box-shadow: none;
}

.side-icon {
  width: 16px;
  height: 16px;
  color: rgba(212, 212, 212, .58);
}

.side-svg {
  width: 16px;
  height: 16px;
  display: block;
}

.side-nav.active .side-icon,
.side-nav:hover .side-icon {
  color: rgba(232, 232, 232, .9);
}

.btn {
  padding-top: 6px;
  padding-bottom: 6px;
}

.btn.small {
  padding-top: 4px;
  padding-bottom: 4px;
}

.hero-shell {
  isolation: isolate;
}

.hero-slider,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slider {
  overflow: hidden;
  z-index: 0;
}

.hero-slide {
  background-size: cover;
  background-position: center;
  transform: translateX(100%);
  transition: transform .76s cubic-bezier(.22, .8, .22, 1);
  will-change: transform;
}

.hero-slide.active {
  transform: translateX(0);
}

.hero-slide.entering {
  transform: translateX(100%);
}

.hero-slide.leaving {
  transform: translateX(-100%);
}

.hero-slider::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, .92) 0%, rgba(10, 10, 10, .38) 52%, rgba(10, 10, 10, .42) 100%),
    linear-gradient(0deg, rgba(10, 10, 10, .72) 0%, transparent 54%);
}

.hero-image,
.hero-image::after {
  background-image: none !important;
}

.hero-content {
  max-width: none;
  width: 100%;
}

.hero-content > div:first-child {
  max-width: 500px;
}

.hero-actions {
  position: relative;
  width: 100%;
}

.hero-dots {
  position: absolute;
  right: 24px;
  bottom: 2px;
  margin-left: 0;
  padding-left: 0;
  padding-right: 4px;
}

.hero-dot {
  width: 6px;
  height: 6px;
}

#playButton {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px 7px 15px;
}

.play-button-sphere {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: currentColor;
}

.play-sphere-icon {
  width: 24px;
  height: 24px;
  display: block;
}

.lobby-inline-actions {
  display: grid;
  grid-template-columns: auto auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 7px;
}

.match-panel {
  max-width: min(900px, calc(100vw - 180px));
}

.profile-card-modern {
  display: grid;
  gap: 14px;
}

.profile-topline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar-wrap {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
}

.profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: #141414;
  display: grid;
  place-items: center;
  color: rgba(212, 212, 212, .74);
}

.profile-avatar-icon {
  width: 25px;
  height: 25px;
}

.profile-online-dot {
  position: absolute;
  right: 1px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #5d8b63;
  border: 2px solid var(--panel);
}

.profile-identity {
  min-width: 0;
}

.profile-identity h2 {
  margin: 0;
  color: #e2e2e2;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity p {
  margin: 7px 0 0;
  color: rgba(212, 212, 212, .55);
  font-size: 12px;
}

.profile-xp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 12px;
  align-items: start;
}

.profile-xp-info {
  display: grid;
  gap: 7px;
}

.profile-xp-bar {
  height: 4px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
  border-radius: 999px;
}

.profile-xp-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: rgba(212, 212, 212, .58);
  border-radius: inherit;
}

.profile-xp-info span {
  color: rgba(212, 212, 212, .55);
  font-size: 11px;
}

.profile-rank-badge {
  width: 28px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  background: rgba(196, 168, 107, .08);
  border: 1px solid rgba(196, 168, 107, .72);
  clip-path: polygon(50% 0, 88% 22%, 88% 78%, 50% 100%, 12% 78%, 12% 22%);
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
  row-gap: 16px;
  padding-top: 2px;
}

.profile-stat-item span,
.profile-stat-item strong {
  display: block;
}

.profile-stat-item span {
  color: rgba(212, 212, 212, .55);
  font-size: 11px;
  line-height: 1.2;
}

.profile-stat-item strong {
  margin-top: 6px;
  color: #e0e0e0;
  font-size: 16px;
  line-height: 1;
  font-weight: 500;
}

.account-card {
  padding: 18px;
}

.setting-control b {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    overflow-x: auto;
  }

  .side-nav {
    width: auto;
    min-width: 110px;
  }

  .lobby-inline-actions {
    grid-template-columns: 1fr 1fr;
  }

  .match-panel {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .lobby-inline-actions {
    grid-template-columns: 1fr;
  }

  .hero-dots {
    right: 14px;
  }
}

/* Final polish: profile rank badge shape, hero cross-fade slide, smaller play icon. */
.hero-slide {
  opacity: 0;
  transform: translateX(100%);
  transition:
    transform .78s cubic-bezier(.22, .8, .22, 1),
    opacity .78s cubic-bezier(.22, .8, .22, 1);
}

.hero-slide.active {
  opacity: 1;
  transform: translateX(0);
}

.hero-slide.entering {
  opacity: 0;
  transform: translateX(100%);
}

.hero-slide.leaving {
  opacity: 0;
  transform: translateX(-100%);
}

#playButton {
  gap: 8px;
  padding-right: 12px;
}

.play-button-sphere,
.play-sphere-icon {
  width: 12px;
  height: 12px;
}

.profile-online-dot {
  display: none !important;
}

.profile-rank-badge {
  width: 32px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  clip-path: none;
  color: var(--gold);
}

.profile-rank-svg {
  width: 32px;
  height: 34px;
  display: block;
  overflow: visible;
}

.profile-rank-svg path {
  fill: rgba(196, 168, 107, .08);
  stroke: rgba(196, 168, 107, .82);
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.profile-rank-svg text {
  fill: var(--gold);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  dominant-baseline: middle;
}

.profile-stat-grid {
  row-gap: 15px;
}


/* Latest polish: larger sidebar, play icon, raised rank badge. */
.app-shell {
  grid-template-columns: 166px minmax(0, 1fr);
}

.sidebar {
  width: 166px;
}

.sidebar-spacer {
  height: 42px;
  min-height: 42px;
  margin-bottom: 12px;
}

.side-nav {
  height: 48px;
  gap: 14px;
  padding: 0 24px;
  font-size: 12px;
}

.side-icon,
.side-svg {
  width: 18px;
  height: 18px;
}

#playButton {
  gap: 10px;
  padding-right: 13px;
}

.play-button-sphere,
.play-sphere-icon {
  width: 18px;
  height: 18px;
}

.profile-xp-row {
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: start;
}

.profile-rank-badge {
  width: 36px;
  height: 38px;
  transform: translateY(-11px);
}

.profile-rank-svg {
  width: 36px;
  height: 38px;
}

.profile-rank-svg text {
  font-size: 12.5px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: auto;
  }

  .side-nav {
    min-width: 122px;
  }
}


/* Patch: recent-game opponent avatar + stable row alignment. */
.games-table-header,
.game-row {
  grid-template-columns: minmax(190px, 1.75fr) .55fr 1.05fr .85fr .55fr .72fr 36px;
}

.col-opponent {
  display: flex !important;
  flex-direction: row !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 10px !important;
  text-align: left !important;
}

.opponent-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .035);
  display: grid;
  place-items: center;
  color: rgba(212, 212, 212, .66);
}

.opponent-avatar-icon {
  width: 15px;
  height: 15px;
}

.opponent-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.opponent-name {
  display: block;
  color: #e0e0e0;
  font-size: 13px;
  line-height: 1.05;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opponent-rank {
  display: block;
  color: rgba(212, 212, 212, .48);
  font-size: 10.5px;
  line-height: 1;
  text-align: left;
}

/* Final recent-games layout: equal content sections, rank lives inside opponent. */
.games-table-header,
.game-row {
  grid-template-columns: repeat(6, minmax(0, 1fr)) 28px !important;
  gap: 8px !important;
}

.col-opponent {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  min-width: 0;
  text-align: left;
}

.opponent-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .045);
  background: var(--panel-2);
  display: grid;
  place-items: center;
  color: var(--muted);
}

.opponent-avatar-icon {
  width: 15px;
  height: 15px;
}

.opponent-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}

.opponent-name {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.05;
}

.opponent-rank {
  font-size: 10px;
  line-height: 1.1;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-date,
.col-duration,
.col-shots,
.col-eight-shots,
.col-result {
  justify-content: flex-start;
}

.games-table-header .col-opponent {
  align-items: center !important;
}

.games-table-header {
  height: 30px !important;
  min-height: 30px !important;
}

.game-row {
  height: 48px !important;
  min-height: 48px !important;
}


/* Emergency dashboard restore guard: keep wallet assets small and keep app-shell visible. */
.app-shell {
  display: grid !important;
}
.dashboard-topbar .top-currencies,
.top-currencies {
  width: auto !important;
  max-width: max-content !important;
}
.dashboard-topbar .resource-display,
.dashboard-topbar .coins-display,
.dashboard-topbar .credits-display,
.resource-display,
.coins-display,
.credits-display {
  width: auto !important;
  height: 24px !important;
  max-height: 24px !important;
  flex: 0 0 auto !important;
}
.dashboard-topbar .resource-display img,
.dashboard-topbar .coins-display img,
.dashboard-topbar .credits-display img,
.top-currencies img,
img[src$="coin.png"],
img[src$="credit.png"] {
  width: 21px !important;
  height: 21px !important;
  min-width: 21px !important;
  min-height: 21px !important;
  max-width: 21px !important;
  max-height: 21px !important;
  object-fit: contain !important;
  display: block !important;
  flex: 0 0 21px !important;
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.chat-message.mine .invite-actions {
  justify-content: flex-end;
}

.chat-message.new-message p {
  border-color: rgba(138, 176, 144, .32);
  background: rgba(138, 176, 144, .08);
}

.new-message-label {
  width: fit-content;
  padding: 2px 6px;
  border: 1px solid rgba(138, 176, 144, .22);
  border-radius: 999px;
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.chat-message.mine .new-message-label {
  justify-self: end;
}

/* Wallet icon refresh: no image assets, only thin symbolic chips. */
.resource-display,
.coins-display,
.credits-display {
  font-weight: 500 !important;
}

.resource-token {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  background: transparent;
  font-size: 7px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.04em;
}

.coin-token,
.coins-display .resource-value {
  color: #c4a86b;
}

.credit-token,
.credits-display .resource-value {
  color: #cfd3dc;
}

.resource-value {
  font-weight: 500 !important;
}


/* Smaller symbolic wallet icons */
.top-currencies {
  padding-right: 12px;
}
.resource-token {
  width: 16px !important;
  height: 16px !important;
  flex-basis: 16px !important;
  font-size: 5.5px !important;
  border-width: 1px;
}
.resource-display,
.coins-display,
.credits-display {
  gap: 5px !important;
  font-size: 12px !important;
}
.resource-value {
  font-weight: 500 !important;
}

/* Profile wins/losses tower graph */
.account-card {
  overflow: hidden;
}

.profile-card-modern {
  height: 100%;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  gap: 12px !important;
}

.profile-card-main {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.profile-record-chart {
  margin-top: auto;
  min-height: 116px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  padding-top: 10px;
}

.profile-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-chart-head strong,
.profile-chart-head span {
  display: block;
}

.profile-chart-head strong {
  color: rgba(226, 226, 226, .92);
  font-size: 12px;
  line-height: 1;
  font-weight: 650;
}

.profile-chart-head span {
  margin-top: 3px;
  color: rgba(212, 212, 212, .42);
  font-size: 10px;
  line-height: 1;
}

.profile-chart-dropdown {
  position: relative;
  z-index: 15;
}

.profile-chart-select {
  height: 24px;
  min-width: 72px;
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: 3px;
  background: #101010;
  color: rgba(212, 212, 212, .72);
  padding: 0 8px;
  font-size: 10px;
  font-weight: 600;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.profile-chart-select:hover,
.profile-chart-dropdown.open .profile-chart-select {
  color: rgba(232, 232, 232, .92);
  border-color: rgba(255, 255, 255, .09);
}

.profile-chart-select i {
  width: 5px;
  height: 5px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: .75;
}

.profile-chart-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 92px;
  display: grid;
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .065);
  border-radius: 4px;
  background: #101010;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .32);
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}

.profile-chart-dropdown.open .profile-chart-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.profile-chart-option {
  width: 100%;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: rgba(212, 212, 212, .62);
  padding: 6px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.profile-chart-option:hover,
.profile-chart-option.selected {
  background: rgba(255, 255, 255, .035);
  color: rgba(232, 232, 232, .92);
}

.profile-chart-body {
  min-height: 86px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
}

.profile-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: rgba(212, 212, 212, .32);
  font-size: 9px;
  line-height: 1;
  padding: 3px 0 16px;
  text-align: right;
}

.profile-graph-bars {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  padding-bottom: 16px;
  position: relative;
}

.profile-graph-bars.month {
  grid-template-columns: repeat(30, minmax(3px, 1fr));
  gap: 2px;
}

.profile-graph-day {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 12px;
  gap: 4px;
  align-items: end;
  justify-items: center;
  position: relative;
}

.profile-graph-tower {
  width: 100%;
  max-width: 14px;
  height: 100%;
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
}

.profile-graph-bars.month .profile-graph-tower {
  max-width: 6px;
}

.profile-bar {
  position: absolute;
  bottom: 0;
  border-radius: 3px 3px 0 0;
  min-height: 0;
}

.profile-bar-back {
  width: 100%;
  height: var(--back-h);
  opacity: .70;
}

.profile-bar-front {
  width: 64%;
  height: var(--front-h);
  opacity: .98;
  z-index: 2;
}

.profile-bar.win {
  background: rgba(112, 166, 122, .92);
}

.profile-bar.loss {
  background: rgba(172, 91, 91, .88);
}

.profile-graph-label {
  color: rgba(212, 212, 212, .36);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.profile-graph-bars.month .profile-graph-label {
  font-size: 7px;
}

.profile-graph-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 20;
  transform: translateX(-50%) translateY(4px);
  min-width: 82px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 4px;
  background: #101010;
  color: rgba(232, 232, 232, .92);
  padding: 7px 8px;
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .34);
}

.profile-graph-day:hover .profile-graph-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .profile-card-modern {
    grid-template-rows: auto auto;
  }
}

/* Latest graph polish */
.account-card .profile-record-chart { align-self: stretch; }
.profile-card-main { flex: 0 0 auto; }


/* Live presence + legal/sidebar/account polish */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-player-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
  color: rgba(212, 212, 212, .78);
  font-size: 12px;
  white-space: nowrap;
}

.live-player-icon {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  color: rgba(232, 232, 232, .92);
}

.live-player-svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.live-player-count strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

#playComputerButton {
  padding-inline: 12px;
}

.sidebar {
  display: flex !important;
  flex-direction: column;
}

.sidebar-legal {
  margin-top: auto;
  padding: 0 14px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}

.sidebar-legal a {
  color: rgba(212, 212, 212, .42);
  text-decoration: none;
}

.sidebar-legal a:hover {
  color: var(--text);
  text-decoration: underline;
}

.sidebar-legal span {
  width: 1px;
  height: 11px;
  background: rgba(255, 255, 255, .12);
}

.settings-email-value {
  color: var(--text);
  font-size: 13px;
  justify-content: flex-end;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .sidebar-legal {
    display: none;
  }

  .live-player-count {
    order: 3;
  }
}

/* Final sidebar + legal link fit + presence polish. */
.app-shell {
  grid-template-columns: 148px minmax(0, 1fr) !important;
}

.sidebar {
  width: 148px;
  min-width: 148px;
}

.sidebar-spacer {
  height: 40px !important;
  min-height: 40px !important;
}

.side-nav {
  height: 47px !important;
  padding: 0 18px !important;
  gap: 13px !important;
  font-size: 12px !important;
}

.side-icon,
.side-svg {
  width: 17px !important;
  height: 17px !important;
}

.sidebar-legal {
  padding: 0 8px 14px !important;
  gap: 5px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  font-size: 8.6px !important;
  line-height: 1.15 !important;
  letter-spacing: -.02em;
}

.sidebar-legal a {
  flex: 0 1 auto;
  min-width: 0;
}

.sidebar-legal span {
  flex: 0 0 1px;
  height: 10px !important;
}

.live-player-count {
  min-width: 68px;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr !important;
  }

  .sidebar {
    width: auto;
    min-width: 0;
  }
}

/* Patch: keep recent-game Add friend fully visible and use regular green-button styling. */
.games-table-header,
.game-row {
  grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(118px, .9fr) !important;
}

.col-action {
  justify-content: flex-end !important;
  overflow: visible !important;
  min-width: 118px !important;
}

.games-table-header .col-action {
  min-width: 118px !important;
}

.add-friend-btn {
  width: auto !important;
  min-width: 112px !important;
  max-width: none !important;
  height: 28px !important;
  padding: 5px 12px !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  line-height: 1 !important;
}

.add-friend-btn .add-friend-plus {
  display: inline-block !important;
  position: relative !important;
  top: -1px !important;
  font-size: 14px !important;
  line-height: 1 !important;
  font-weight: 900 !important;
}

.add-friend-btn .add-friend-text {
  display: inline-block !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
}

.request-action-svg {
  width: 13px !important;
  height: 13px !important;
  stroke-width: 2.4 !important;
}

.accept-request,
.decline-request,
.cancel-request {
  display: inline-grid !important;
  place-items: center !important;
}


/* Patch: simplified hero welcome, globe/login play icon, and clean recent-game friend states. */
.hero-welcome-copy {
  display: grid;
  gap: 4px;
}

.hero-welcome-copy h1,
#heroTitle {
  margin: 0;
  font-size: clamp(38px, 5.6vw, 64px);
  line-height: .98;
  letter-spacing: -.045em;
  color: #e8e8e8;
}

.hero-player-name {
  margin: 0;
  color: #a5a5a5;
  font-size: clamp(18px, 2.2vw, 27px);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.02em;
}

#playButton .play-button-sphere {
  width: 18px !important;
  height: 18px !important;
}

#playButton .play-sphere-icon {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 2 !important;
}

.add-friend-btn {
  min-width: 116px !important;
  height: 28px !important;
  padding: 5px 12px !important;
  border-radius: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  line-height: 1 !important;
}

.add-friend-btn .add-friend-plus {
  display: inline-grid !important;
  place-items: center !important;
  position: static !important;
  top: auto !important;
  width: 13px !important;
  height: 13px !important;
  line-height: 1 !important;
}

.add-friend-plus-icon {
  width: 13px !important;
  height: 13px !important;
  display: block !important;
  stroke-width: 2.6 !important;
}

.add-friend-btn .add-friend-text {
  display: inline-block !important;
  line-height: 1 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  color: inherit !important;
}

.add-friend-state {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  color: #5f5f5f;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}

.add-friend-state.friends {
  color: rgba(138, 176, 144, .62);
}

.add-friend-state.pending {
  color: rgba(196, 168, 107, .62);
}

/* Patch: empty hero copy + left-side button SVG icons. */
.hero-welcome-copy,
#heroTitle,
#heroPlayerName {
  display: none !important;
}

.hero-content {
  align-content: end !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.button-icon,
.play-button-sphere {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.button-svg {
  width: 14px;
  height: 14px;
  display: block;
}

#playButton {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  gap: 8px;
}

#playButton .play-button-sphere {
  width: 18px;
  height: 18px;
  margin: 0;
  order: 0;
}

#playButton .play-sphere-icon {
  width: 18px;
  height: 18px;
  display: block;
}

#playComputerButton {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

#openInviteModal .button-svg,
#chatInviteButton .button-svg,
#settingsLogoutButton .button-svg,
#settingsDeleteAccountButton .button-svg,
#playComputerButton .button-svg {
  width: 14px;
  height: 14px;
}


/* Patch: cleaner button icons and equal green/gray sizing. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn.primary:not(.small),
.btn.green:not(.small),
#playButton,
#playComputerButton {
  padding: 6px 14px !important;
  min-height: 31px;
}

#playButton,
#playComputerButton {
  gap: 7px !important;
}

.button-svg,
#playButton .play-sphere-icon,
#playComputerButton .button-svg,
#openInviteModal .button-svg,
#chatInviteButton .button-svg,
#settingsLogoutButton .button-svg,
#settingsDeleteAccountButton .button-svg {
  width: 14px !important;
  height: 14px !important;
  display: block;
  flex: 0 0 auto;
}

#playButton .play-button-sphere {
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
}

.add-friend-btn.btn.green {
  padding: 6px 14px !important;
  min-width: 124px !important;
  min-height: 31px !important;
  height: 31px !important;
  border-radius: 4px !important;
}

/* Emergency-safe polish overrides */
.resource-display img,
.resource-token img,
.coins-display img,
.credits-display img {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  object-fit: contain !important;
}
.game-row {
  overflow: visible;
}
.col-action {
  min-width: 118px;
  justify-content: flex-end;
  overflow: visible;
}
.add-friend-btn.btn.green {
  width: auto;
  min-width: 108px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 4px;
  line-height: 1;
}
.add-friend-btn .icon,
.add-friend-plus-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  transform: translateY(-1px);
}
.add-friend-state {
  display: inline-flex;
  justify-content: flex-end;
  width: 100%;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

/* Final hero action alignment: play controls/live count left, slideshow dots right on same line. */
.hero-content .hero-actions {
  position: relative !important;
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

.hero-content .hero-dots {
  position: static !important;
  right: auto !important;
  bottom: auto !important;
  margin-left: auto !important;
  padding: 0 24px 0 16px !important;
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
}
