/* Illustration objet dans inventaire/mix/échange */
.item-illu {
  width: 136px;
  height: 136px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
}

.item-illu-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem;
  cursor: zoom-in;
}

.item-illu-btn:focus-visible {
  outline: 2px solid rgba(25, 211, 197, 0.72);
  outline-offset: 2px;
}

.item-illu img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-illu svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
:root {
  --bg-0: #08111b;
  --bg-1: #0f1f2e;
  --card: #13293d;
  --card-soft: #1a3851;
  --text: #f4f7fb;
  --muted: #9eb1c4;
  --aqua: #19d3c5;
  --sun: #f4a259;
  --danger: #ff5d73;
  --line: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px circle at 10% 15%, #15334d 0%, transparent 55%),
    radial-gradient(900px circle at 90% 85%, #2b3b1a 0%, transparent 45%),
    linear-gradient(135deg, var(--bg-0), #090f16 45%, var(--bg-1));
  color: var(--text);
  font-family: "Chakra Petch", sans-serif;
  overflow-x: hidden;
}

body {
  position: relative;
  padding: 1.2rem;
}

.presence-drawer {
  --presence-drawer-width: 250px;
  --presence-toggle-width: 44px;
  position: fixed;
  left: calc(var(--presence-toggle-width) - var(--presence-drawer-width));
  top: 20px;
  width: var(--presence-drawer-width);
  display: flex;
  align-items: stretch;
  z-index: 18;
  transition: left 0.25s ease;
}

.presence-drawer.is-open {
  left: 0;
}

.presence-toggle {
  width: 44px;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.95), rgba(13, 31, 44, 0.92));
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  position: relative;
  z-index: 2;
  padding-bottom: 0.6rem;
}

.presence-toggle::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #39d98a;
  box-shadow: 0 0 0 3px rgba(57, 217, 138, 0.2);
}

.presence-toggle::after {
  content: '▸';
  font-size: 0.8rem;
  line-height: 1;
  color: #d7e6f4;
  transform: rotate(90deg) translateY(0);
  transition: transform 0.22s ease, color 0.22s ease;
}

.presence-toggle[aria-expanded='true']::after {
  transform: rotate(270deg) translateY(-1px);
  color: #19d3c5;
}

.presence-content {
  width: 206px;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 0 0 0 12px;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.95), rgba(13, 31, 44, 0.92));
  padding: 0.7rem;
}

.presence-title {
  margin: 0;
  color: #d5e6f5;
  font-weight: 700;
}

.presence-list {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.4rem;
  max-height: 260px;
  overflow: auto;
}

.presence-player,
.presence-empty {
  margin: 0;
  font-size: 0.92rem;
}

.presence-player {
  color: #88ebca;
}

.presence-empty {
  color: var(--muted);
}

.player-title {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.86em;
  letter-spacing: 0.01em;
}

.player-title em {
  font-style: italic;
}

.player-title-rarity-0 {
  color: #c8d2db;
}

.player-title-rarity-1 {
  color: #8fd3ff;
}

.player-title-rarity-2 {
  color: #7ce8a4;
}

.player-title-rarity-3 {
  color: #d6a8ff;
}

.player-title-rarity-4 {
  color: #ffc88d;
}

.player-title-rarity-5 {
  color: #ffd96f;
}

.player-title-rarity-legendary {
  color: #ff8e66;
  text-shadow: 0 0 10px rgba(255, 142, 102, 0.35);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.24;
  pointer-events: none;
  z-index: -1;
}

.bg-orb {
  position: fixed;
  width: 42vw;
  max-width: 520px;
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(36px);
  opacity: 0.22;
  z-index: -2;
}

.orb-a {
  background: #0ad6c5;
  top: -12vw;
  left: -10vw;
}

.orb-b {
  background: #ffc06d;
  right: -12vw;
  bottom: -18vw;
}

.topbar,
main,
.footer {
  width: min(1120px, 100%);
  margin-inline: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.6rem;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.logo-token {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 26px rgba(7, 19, 30, 0.4);
  overflow: hidden;
}

.logo-token img {
  width: 100%;
  height: 100%;
  display: block;
}

.logo-title {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.logo-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.top-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.btn {
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-1px) scale(1.02);
}

.btn.solid {
  color: #0b1b2a;
  background: linear-gradient(135deg, var(--sun), #ffd7a2);
  box-shadow: 0 8px 20px rgba(244, 162, 89, 0.35);
}

.btn.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.user-zone {
  display: none;
  align-items: center;
  gap: 0.7rem;
}

.user-zone.is-visible {
  display: flex;
}

.glu-balance {
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #d6e5f2;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
}

.glu-balance span {
  color: var(--sun);
  font-weight: 700;
}

.notif-wrap {
  position: relative;
}

.notif-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  position: relative;
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #0b1b2a;
  background: #ffd7a2;
  padding: 0 4px;
}

.notif-badge.is-hidden {
  display: none;
}

.notif-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  width: min(360px, 78vw);
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.95), rgba(13, 31, 44, 0.92));
  padding: 0.55rem;
  display: none;
  z-index: 20;
}

.notif-panel.is-open {
  display: block;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.notif-head p {
  margin: 0;
  font-family: "Syne", sans-serif;
}

.notif-list {
  display: grid;
  gap: 0.45rem;
  max-height: 260px;
  overflow: auto;
}

.notif-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.55rem;
}

.notif-item.is-unread {
  border-color: rgba(25, 211, 197, 0.65);
}

.notif-item p,
.notif-item span {
  margin: 0;
  display: block;
}

.notif-item span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-menu-wrap {
  position: relative;
}

.profile-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background-position: center;
  background-size: cover;
  overflow: hidden;
}

.profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 160px;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.95), rgba(13, 31, 44, 0.92));
  display: none;
  z-index: 15;
}

.profile-menu-wrap:hover .profile-dropdown,
.profile-menu-wrap:focus-within .profile-dropdown {
  display: grid;
}

.profile-dropdown button {
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
}

.profile-dropdown button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hero-selector {
  margin-top: 1.5rem;
}

.hero-panel,
.footer {
  border: 1px solid var(--line);
  backdrop-filter: blur(5px);
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.88), rgba(13, 31, 44, 0.75));
}

.hero-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-title {
  margin: 0.3rem 0 1rem;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-family: "Syne", sans-serif;
}

.hero-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.72rem 0.68rem;
  font-size: 0.92rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(25, 211, 197, 0.45);
}

.hero-card.is-active {
  border-color: rgba(25, 211, 197, 0.75);
  background: linear-gradient(135deg, rgba(25, 211, 197, 0.15), rgba(244, 162, 89, 0.2));
  box-shadow: 0 10px 30px rgba(25, 211, 197, 0.2);
}

.hero-panel {
  margin-top: 0.9rem;
  border-radius: 15px;
  padding: 0.78rem 0.9rem;
  min-height: 96px;
}

.hero-panel p,
.hero-panel h2,
.hero-panel span {
  margin: 0;
}

.hero-panel p {
  color: var(--aqua);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hero-panel h2 {
  margin-top: 0.45rem;
  font-family: "Syne", sans-serif;
  font-size: 1.12rem;
}

.hero-panel span {
  margin-top: 0.45rem;
  display: inline-block;
  color: var(--muted);
}

.hero-panel-action {
  margin-top: 0.8rem;
}

.wallet-embed {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: visible;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.88), rgba(13, 31, 44, 0.75));
  padding: 0.9rem;
  min-height: 0;
}

.wallet-inline-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wallet-embed.is-hidden {
  display: none;
}

.games-embed {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: visible;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.88), rgba(13, 31, 44, 0.75));
  padding: 0.9rem;
}

.games-embed.is-hidden {
  display: none;
}

.tournaments-embed {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: visible;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.88), rgba(13, 31, 44, 0.75));
  padding: 0.9rem;
}

.tournaments-embed.is-hidden {
  display: none;
}

.tournaments-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
}

.tournament-create-card,
.tournament-list-card,
.tournament-detail-card {
  min-height: 180px;
}

.tournament-detail-card {
  grid-column: 1 / -1;
}

.tournament-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.42rem;
}

.tournament-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  color: #d8e7f5;
  background: rgba(255, 255, 255, 0.03);
}

.tournament-badge.is-ok {
  border-color: rgba(124, 232, 164, 0.65);
  color: #8bf2bc;
}

.tournament-badge.is-warn {
  border-color: rgba(255, 165, 165, 0.65);
  color: #ffb0b0;
}

.tournament-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.7rem;
}

.tournament-item.is-selected {
  border-color: rgba(25, 211, 197, 0.72);
  background: linear-gradient(145deg, rgba(25, 211, 197, 0.13), rgba(255, 255, 255, 0.04));
}

.tournament-item h4 {
  margin: 0;
  font-family: "Syne", sans-serif;
}

.tournament-item p {
  margin: 0.22rem 0 0;
}

.tournament-actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.btn-danger {
  border-color: rgba(255, 136, 136, 0.52) !important;
  color: #ffd3d3 !important;
  background: rgba(124, 34, 44, 0.32) !important;
}

.tournament-detail-head {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.72rem;
}

.tournament-detail-head h4 {
  margin: 0;
  font-family: "Syne", sans-serif;
}

.tournament-players {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.tournament-player {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.03);
}

.tournament-bracket-wrap {
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.72rem;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.02);
}

.tournament-bracket {
  display: grid;
  gap: 0.75rem;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 300px);
  align-items: start;
}

.tournament-round {
  display: grid;
  gap: 0.55rem;
}

.tournament-round h5 {
  margin: 0;
  color: #f0d7ac;
  font-family: "Syne", sans-serif;
}

.tournament-match {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.55rem;
  position: relative;
}

.tournament-match.is-completed {
  border-color: rgba(25, 211, 197, 0.55);
}

.tournament-match p {
  margin: 0.14rem 0;
}

.tournament-match .winner {
  color: #9ef1cf;
  font-weight: 700;
}

.tournament-match .vs {
  color: var(--muted);
  font-size: 0.84rem;
}

.tournament-connector {
  position: absolute;
  right: -56px;
  top: 50%;
  width: 52px;
  height: 0;
  border-top: 3px solid rgba(142, 232, 214, 0.85);
  transform: translateY(-50%);
  pointer-events: none;
}

.tournament-connector::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -5px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(142, 232, 214, 0.95);
  box-shadow: 0 0 0 4px rgba(142, 232, 214, 0.18);
}

.tournament-odds-board {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.38rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.tournament-odds-item {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 0.42rem 0.5rem;
  background: rgba(255, 255, 255, 0.03);
}

.tournament-odds-item p,
.tournament-odds-item span {
  margin: 0;
}

.tournament-odds-item span {
  display: block;
  color: #c9d8e6;
  font-size: 0.84rem;
  margin-top: 0.1rem;
}

.tournament-inline-form {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.tournament-inline-form input,
.tournament-inline-form select {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 0.38rem 0.48rem;
  font: inherit;
}

.tournament-bracket.is-game-chess .tournament-match {
  border-color: rgba(126, 200, 227, 0.5);
  background: linear-gradient(150deg, rgba(35, 60, 83, 0.42), rgba(15, 36, 53, 0.35));
}

.tournament-bracket.is-game-counetstrike .tournament-match {
  border-color: rgba(255, 180, 120, 0.5);
  background: linear-gradient(150deg, rgba(83, 54, 30, 0.42), rgba(45, 34, 22, 0.35));
}

.tournament-bracket.is-game-overwatch .tournament-match {
  border-color: rgba(255, 163, 71, 0.56);
  background: linear-gradient(150deg, rgba(95, 52, 24, 0.44), rgba(36, 28, 18, 0.35));
}

.tournament-bracket.is-game-lol .tournament-match {
  border-color: rgba(171, 140, 255, 0.56);
  background: linear-gradient(150deg, rgba(52, 37, 89, 0.44), rgba(28, 20, 44, 0.35));
}

.tournament-bracket.is-game-apex .tournament-match {
  border-color: rgba(255, 109, 109, 0.5);
  background: linear-gradient(150deg, rgba(89, 34, 43, 0.44), rgba(44, 20, 24, 0.35));
}

.tournament-bracket.is-game-jdr .tournament-match {
  border-color: rgba(121, 220, 169, 0.5);
  background: linear-gradient(150deg, rgba(31, 74, 61, 0.45), rgba(17, 40, 35, 0.35));
}

.tournament-bracket.is-game-arena .tournament-match {
  border-color: rgba(244, 153, 96, 0.54);
  background: linear-gradient(150deg, rgba(86, 42, 27, 0.44), rgba(35, 24, 31, 0.36));
}

.inventory-embed {
  margin-top: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: visible;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.88), rgba(13, 31, 44, 0.75));
  padding: 0.9rem;
}

.inventory-embed.is-hidden,
.inventory-panel.is-hidden {
  display: none;
}

.is-hidden {
  display: none;
}

.inventory-submenu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.inventory-submenu-btn {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.inventory-submenu-btn.is-active {
  border-color: rgba(25, 211, 197, 0.8);
  background: rgba(25, 211, 197, 0.16);
  color: #d7fffa;
}

.inventory-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.9rem;
}

.inventory-card h3 {
  margin: 0 0 0.45rem;
  font-family: "Syne", sans-serif;
}

.inventory-card p {
  margin: 0;
  color: var(--muted);
}

.inventory-actions {
  margin-top: 0.8rem;
}

.inventory-toolbar {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.inventory-toolbar label {
  display: grid;
  gap: 0.25rem;
  color: #d2deea;
  font-size: 0.88rem;
}

.inventory-toolbar input,
.inventory-toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.5rem 0.6rem;
  font: inherit;
}

.market-toolbar {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.market-toolbar label {
  display: grid;
  gap: 0.25rem;
  color: #d2deea;
  font-size: 0.88rem;
}

.market-toolbar input,
.market-toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.5rem 0.6rem;
  font: inherit;
}

.inventory-list {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.6rem;
}

.inventory-list-two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-catalog-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.inventory-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.75rem;
}

.inventory-list .inventory-item:not(.market-item) {
  display: grid;
  gap: 0.32rem 0.8rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.inventory-list .inventory-item:not(.market-item) > :not(.item-illu) {
  grid-column: 1;
}

.inventory-list .inventory-item:not(.market-item) .item-illu {
  grid-column: 2;
  grid-row: 1 / span 7;
  justify-self: end;
  align-self: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem;
}

.inventory-catalog-grid .catalog-item {
  display: grid;
  gap: 0.36rem;
  grid-template-columns: 1fr;
  align-content: start;
}

.inventory-catalog-grid .catalog-item > :not(.item-illu) {
  grid-column: auto;
}

.inventory-catalog-grid .catalog-item .item-illu {
  width: 112px;
  height: 112px;
  grid-column: auto;
  grid-row: auto;
  justify-self: center;
}

.catalog-item.is-owned {
  border-color: rgba(126, 232, 173, 0.5);
  background: linear-gradient(150deg, rgba(126, 232, 173, 0.12), rgba(255, 255, 255, 0.03));
}

.catalog-item.is-missing {
  opacity: 0.7;
  filter: grayscale(0.45);
}

.item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.item-main-line {
  margin: 0;
}

.item-rarity {
  font-weight: 700;
}

.item-rarity-0 {
  color: #c9d4df;
}

.item-rarity-1 {
  color: #86d1ff;
}

.item-rarity-2 {
  color: #7fe8ad;
}

.item-rarity-3 {
  color: #d0a9ff;
}

.item-rarity-4 {
  color: #ffcc8a;
  text-shadow: 0 0 10px rgba(255, 204, 138, 0.42);
}

.item-rarity-5 {
  color: #ffd96f;
  text-shadow: 0 0 12px rgba(255, 217, 111, 0.52);
}

.item-rarity-legendary {
  color: #ff986a;
  text-shadow: 0 0 12px rgba(255, 152, 106, 0.58);
}

.inventory-item.is-selected {
  border-color: rgba(25, 211, 197, 0.72);
  background: linear-gradient(150deg, rgba(25, 211, 197, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 0 1px rgba(25, 211, 197, 0.2) inset;
}

.btn-transfer-toggle,
.btn-chest-toggle,
.btn-mix-add,
.btn-destroy-toggle {
  min-width: 92px;
}

.inventory-item.is-locked {
  opacity: 0.74;
}

.inventory-item p,
.inventory-item strong,
.inventory-item span {
  margin: 0;
  display: block;
}

.inventory-item span {
  color: var(--muted);
  margin-top: 0.2rem;
  word-break: break-all;
}

.inventory-destroy-summary {
  margin-top: 0.8rem;
  color: #ffd7a2;
  font-weight: 700;
}

.btn-destroy-toggle[disabled] {
  opacity: 0.62;
  cursor: not-allowed;
}

.market-item {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
}

.market-illustration {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: "Syne", sans-serif;
  font-weight: 800;
  color: #0b1b2a;
  background: linear-gradient(145deg, #ffd7a2, #19d3c5);
  overflow: hidden;
}
.market-illustration img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.market-illustration svg {
  width: 100%;
  height: 100%;
}

.market-main p {
  margin: 0;
}

.market-meta {
  margin-top: 0.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.market-price {
  margin: 0;
  color: #ffd7a2;
  font-weight: 700;
  text-align: right;
}

.market-buy {
  margin-top: 0.4rem;
}

#chest-reward-content .inventory-item {
  background: linear-gradient(150deg, rgba(25, 211, 197, 0.1), rgba(244, 162, 89, 0.1));
  border-color: rgba(25, 211, 197, 0.45);
}

.inventory-item-modal-card {
  width: min(2640px, 98vw);
}

.inventory-item-modal-body {
  display: grid;
  grid-template-columns: minmax(620px, 2fr) minmax(280px, 1fr);
  gap: 0.85rem;
  max-height: min(84vh, 920px);
  overflow: auto;
}

.inventory-item-modal-image-wrap {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(10, 22, 32, 0.78);
  overflow: hidden;
  padding: 0.35rem;
  display: grid;
  place-items: center;
}

.inventory-item-modal-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
}

.inventory-item-modal-meta {
  display: grid;
  gap: 0.35rem;
}

.inventory-item-modal-meta p {
  margin: 0;
}

.inventory-item-modal-meta strong {
  color: #d5f4ef;
}

.inventory-trade-modal-card {
  width: min(1240px, 98vw);
}

.inventory-trade-confirm-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
  color: #cfe8f3;
}

.inventory-trade-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-trade-drawer {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.7rem;
}

.inventory-trade-drawer h4 {
  margin: 0 0 0.55rem;
  font-family: "Syne", sans-serif;
}

.inventory-trade-drawer label {
  display: grid;
  gap: 0.25rem;
  color: #d2deea;
  font-size: 0.88rem;
}

.inventory-trade-drawer input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.5rem 0.6rem;
  font: inherit;
}

.inventory-trade-items {
  margin-top: 0.62rem;
  max-height: 44vh;
  overflow: auto;
}

.gameplay-shell.is-hidden {
  display: none;
}

.lobby-page {
  padding: 0.9rem;
}

.lobby-main {
  max-width: 1160px;
  margin: 0.8rem auto 0;
}

.lobby-note {
  margin: 0 0 0.85rem;
  color: var(--muted);
}

.footer {
  margin-top: 1.2rem;
  border-radius: 15px;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  z-index: 20;
}

.modal.is-open {
  display: grid;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 11, 18, 0.72);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, calc(100% - 1.2rem));
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.95), rgba(13, 31, 44, 0.92));
  padding: 1rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.modal-head h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
}

.modal-close {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  width: 34px;
  height: 34px;
  font: inherit;
}

.chat-bubble {
  position: fixed;
  right: 20px;
  bottom: 18px;
  z-index: 24;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sun), #ffd7a2);
  color: #0b1b2a;
  font: inherit;
  font-weight: 700;
  padding: 0.7rem 1rem;
  box-shadow: 0 10px 28px rgba(7, 19, 30, 0.45);
  cursor: pointer;
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 72px;
  width: min(760px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 120px));
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.96), rgba(13, 31, 44, 0.95));
  z-index: 24;
  display: none;
  overflow: hidden;
}

.chat-panel.is-open {
  display: grid;
  grid-template-rows: auto 1fr;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
}

.chat-head h3 {
  margin: 0;
  font-family: "Syne", sans-serif;
}

.chat-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 0;
}

.chat-friends {
  border-right: 1px solid var(--line);
  padding: 0.55rem;
  display: grid;
  gap: 0.45rem;
  overflow: auto;
}

.chat-friend-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  padding: 0.55rem;
}

.chat-friend-item.is-active {
  border-color: rgba(25, 211, 197, 0.75);
  background: rgba(25, 211, 197, 0.14);
}

.chat-friend-item p,
.chat-friend-item span,
.chat-friend-item strong {
  margin: 0;
  display: block;
}

.chat-friend-item span {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.chat-thread {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
}

.chat-thread-title {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.7rem;
  color: #d8e8f8;
  font-weight: 700;
}

.chat-messages {
  display: grid;
  gap: 0.4rem;
  padding: 0.55rem;
  overflow: auto;
  align-content: start;
}

.chat-message {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  max-width: 85%;
  background: rgba(255, 255, 255, 0.03);
}

.chat-message.me {
  justify-self: end;
  border-color: rgba(25, 211, 197, 0.6);
  background: rgba(25, 211, 197, 0.12);
}

.chat-message p,
.chat-message span {
  margin: 0;
  display: block;
}

.chat-message span {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.chat-send-form {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  padding: 0.55rem;
}

.chat-send-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.55rem 0.6rem;
  font: inherit;
}

.signup-form {
  display: grid;
  gap: 0.75rem;
}

.signup-form label,
.login-form label,
.profile-form label {
  display: grid;
  gap: 0.3rem;
  color: #d2deea;
}

.signup-form input,
.login-form input,
.profile-form input,
.profile-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.6rem 0.65rem;
  font: inherit;
}

.signup-form input:focus,
.login-form input:focus,
.profile-form input:focus,
.profile-form textarea:focus {
  outline: 2px solid rgba(25, 211, 197, 0.45);
  outline-offset: 1px;
}

.login-form {
  display: grid;
  gap: 0.75rem;
}

.profile-modal-card {
  width: min(560px, calc(100% - 1.2rem));
}

.profile-form {
  display: grid;
  gap: 0.75rem;
}

.profile-title-help,
.profile-active-title {
  margin: 0.2rem 0 0.6rem;
  color: var(--muted);
}

.title-item.title-locked {
  opacity: 0.58;
  filter: grayscale(0.65);
}

.profile-title-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.profile-title-catalog {
  display: grid;
  gap: 0.65rem;
}

.profile-form h3 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.05rem;
}

.password-form {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.profile-form textarea {
  resize: vertical;
}

.profile-page .top-actions .btn {
  text-decoration: none;
}

.profile-layout {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.profile-avatar-card,
.profile-content-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.9), rgba(13, 31, 44, 0.85));
  padding: 1rem;
}

.profile-avatar-card {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: "Syne", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  background-position: center;
  background-size: cover;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-name {
  margin: 0;
  font-weight: 700;
}

.avatar-upload {
  display: grid;
  gap: 0.4rem;
  color: #d2deea;
}

.avatar-upload input {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.55rem;
  font: inherit;
}

.avatar-builder {
  margin-top: 0.25rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  display: grid;
  gap: 0.52rem;
}

.avatar-builder h3 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1rem;
}

.avatar-builder label {
  display: grid;
  gap: 0.25rem;
  color: #d2deea;
  font-size: 0.89rem;
}

.avatar-builder select {
  width: 50%;
  max-width: 50%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f7fb;
  color: #0f1b2a;
  padding: 0.52rem 0.56rem;
  font: inherit;
}

.avatar-builder select option {
  color: #0f1b2a;
}

.avatar-builder-actions {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: 1fr;
}

.avatar-builder-actions .btn {
  width: 100%;
  padding: 0.46rem 0.52rem;
  white-space: normal;
}

.profile-content-card .profile-form h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.2rem;
}

.wallet-grid {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wallet-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.9), rgba(13, 31, 44, 0.85));
  padding: 1rem;
}

.wallet-card h2,
.wallet-balance h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
}

.wallet-balance p,
.wallet-balance span {
  margin: 0;
  color: var(--muted);
}

.wallet-balance h1 {
  margin: 0.35rem 0 0.45rem;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
}

.wallet-form {
  display: grid;
  gap: 0.75rem;
}

.wallet-form label {
  display: grid;
  gap: 0.3rem;
  color: #d2deea;
}

.wallet-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.6rem 0.65rem;
  font: inherit;
}

.wallet-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.6rem 0.65rem;
  font: inherit;
  resize: vertical;
}

.wallet-history {
  grid-column: 1 / -1;
}

.wallet-list {
  display: grid;
  gap: 0.65rem;
}

.wallet-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
}

.wallet-item p,
.wallet-item strong,
.wallet-item span {
  margin: 0;
  display: block;
}

.wallet-item span {
  color: var(--muted);
  margin-top: 0.25rem;
}

.wallet-actions {
  margin-top: 0.55rem;
  display: flex;
  gap: 0.5rem;
}

.wallet-actions .btn {
  padding: 0.45rem 0.6rem;
}

.wallet-in {
  color: #7ce7bf;
}

.wallet-out {
  color: #ff9aa8;
}

.wallet-empty {
  margin: 0;
  color: var(--muted);
}

.wallet-code-result {
  margin-top: 0.55rem;
}

.wallet-code-reward {
  border: 1px solid rgba(130, 236, 194, 0.45);
  border-radius: 10px;
  padding: 0.55rem;
  background: linear-gradient(150deg, rgba(130, 236, 194, 0.09), rgba(109, 180, 255, 0.08));
  display: grid;
  gap: 0.18rem;
}

.wallet-code-reward strong,
.wallet-code-reward p,
.wallet-code-reward span {
  margin: 0;
}

.wallet-code-reward strong {
  color: #baf7da;
}

.wallet-code-reward p,
.wallet-code-reward span {
  color: #d7e6f5;
}

.chess-page {
  padding: 0.8rem;
}

.chess-layout {
  width: 100%;
  margin: 0;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
}

.chess-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(19, 41, 61, 0.9), rgba(13, 31, 44, 0.85));
  padding: 0.9rem;
}

.game-selector-card {
  grid-column: 1 / -1;
}

.game-list {
  display: grid;
  gap: 0.75rem;
}

.game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
}

.game-card p {
  margin: 0;
  color: var(--muted);
}

.game-card .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.game-card.is-disabled {
  opacity: 0.55;
  filter: grayscale(0.55);
  border-color: rgba(255, 255, 255, 0.18);
}

.game-card.is-disabled .btn {
  cursor: not-allowed;
  box-shadow: none;
}

.game-card.is-casino {
  border-color: rgba(244, 162, 89, 0.52);
  background:
    radial-gradient(120% 130% at 88% 0%, rgba(255, 214, 161, 0.2), transparent 60%),
    linear-gradient(140deg, rgba(46, 27, 14, 0.82), rgba(21, 37, 34, 0.78));
  box-shadow: inset 0 0 0 1px rgba(255, 223, 176, 0.14);
}

.game-card.is-casino h3 {
  color: #ffd6aa;
}

.game-card.is-casino p {
  color: #e3cdb8;
}

.game-card.is-casino .btn {
  color: #271705;
  border-color: rgba(255, 223, 176, 0.68);
  background: linear-gradient(150deg, #f5c787, #dda466);
  box-shadow: 0 9px 24px rgba(221, 164, 102, 0.28);
}

.game-card.is-rpg {
  border-color: rgba(120, 200, 80, 0.52);
  background:
    radial-gradient(120% 130% at 12% 100%, rgba(120, 200, 80, 0.18), transparent 60%),
    linear-gradient(140deg, rgba(14, 46, 20, 0.82), rgba(15, 30, 40, 0.78));
  box-shadow: inset 0 0 0 1px rgba(120, 200, 80, 0.14);
}
.game-card.is-rpg h3 { color: #a0e878; }
.game-card.is-rpg p { color: #b8d8c0; }
.game-card.is-rpg .btn {
  color: #0a1e0a;
  border-color: rgba(120, 200, 80, 0.68);
  background: linear-gradient(150deg, #78c850, #5aa038);
  box-shadow: 0 9px 24px rgba(90, 160, 56, 0.28);
}

.game-card.is-arena {
  border-color: rgba(234, 133, 86, 0.52);
  background:
    radial-gradient(120% 130% at 90% 0%, rgba(234, 133, 86, 0.2), transparent 60%),
    linear-gradient(140deg, rgba(52, 24, 18, 0.82), rgba(22, 28, 43, 0.8));
  box-shadow: inset 0 0 0 1px rgba(255, 205, 173, 0.14);
}

.game-card.is-arena h3 { color: #ffc7a8; }
.game-card.is-arena p { color: #e6c8bb; }
.game-card.is-arena .btn {
  color: #2e1208;
  border-color: rgba(255, 195, 160, 0.7);
  background: linear-gradient(150deg, #f2a471, #d97a45);
  box-shadow: 0 9px 24px rgba(217, 122, 69, 0.28);
}

.arena-page {
  padding: 0.85rem;
  background:
    radial-gradient(1100px circle at 12% 12%, rgba(243, 132, 84, 0.2), transparent 58%),
    radial-gradient(900px circle at 86% 84%, rgba(84, 176, 215, 0.2), transparent 48%),
    linear-gradient(132deg, #10131f, #21171b 48%, #111a24);
}

.arena-main {
  max-width: 1180px;
  margin: 0.9rem auto 0;
  display: grid;
  gap: 0.9rem;
}

.arena-header-card {
  border: 1px solid rgba(255, 204, 176, 0.35);
}

.arena-balance {
  margin-top: 0.4rem;
  color: #ffd9c4;
}

.arena-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 0.9rem;
}

.arena-panel h3,
.arena-history-card h3 {
  margin: 0 0 0.65rem;
  color: #fff1e6;
}

.arena-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.arena-queue {
  margin: 0.45rem 0 0;
  color: rgba(230, 228, 238, 0.78);
  font-size: 0.82rem;
}

.arena-match-item {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.arena-match-item p {
  margin: 0;
  color: rgba(239, 244, 250, 0.92);
}

.arena-match-item span {
  display: block;
  margin-top: 2px;
  color: rgba(213, 222, 236, 0.74);
  font-size: 0.78rem;
}

.arena-match-item.is-win {
  border-color: rgba(120, 200, 80, 0.55);
}

.arena-match-item.is-loss {
  border-color: rgba(236, 111, 111, 0.55);
}

.casino-page {
  padding: 0.85rem;
  background:
    radial-gradient(1100px circle at 18% 12%, rgba(202, 141, 70, 0.2), transparent 58%),
    radial-gradient(900px circle at 88% 80%, rgba(30, 100, 84, 0.2), transparent 48%),
    linear-gradient(132deg, #090f17, #17131f 46%, #0f1a1f);
}

.casino-main {
  max-width: 1260px;
  margin: 0.9rem auto 0;
  display: grid;
  gap: 0.9rem;
}

.casino-header-card {
  border: 1px solid rgba(255, 225, 185, 0.32);
  border-radius: 18px;
  padding: 1rem;
  background:
    radial-gradient(130% 160% at 95% -10%, rgba(248, 197, 132, 0.26), transparent 65%),
    linear-gradient(150deg, rgba(35, 27, 18, 0.92), rgba(13, 26, 30, 0.9));
  box-shadow:
    inset 0 0 0 1px rgba(255, 237, 213, 0.08),
    0 20px 42px rgba(0, 0, 0, 0.35);
}

.casino-topline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.casino-kicker {
  margin: 0;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #f0bf83;
  font-size: 0.75rem;
}

.casino-title {
  margin: 0.22rem 0 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(1.6rem, 3.1vw, 2.5rem);
  color: #fff5e7;
}

.casino-subtitle {
  margin: 0.25rem 0 0;
  color: #d6c6b7;
}

.casino-balance {
  min-width: 220px;
  border-radius: 14px;
  border: 1px solid rgba(255, 226, 189, 0.38);
  padding: 0.7rem 0.8rem;
  background: linear-gradient(145deg, rgba(37, 30, 21, 0.86), rgba(27, 46, 41, 0.82));
}

.casino-balance p {
  margin: 0;
  color: #d9be9d;
  font-size: 0.86rem;
}

.casino-balance strong {
  display: block;
  margin-top: 0.18rem;
  font-size: 1.45rem;
  color: #ffdfa6;
}

.casino-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.casino-card {
  border: 1px solid rgba(255, 223, 182, 0.22);
  border-radius: 18px;
  padding: 0.95rem;
  background:
    radial-gradient(120% 140% at -10% 0%, rgba(255, 200, 120, 0.08), transparent 62%),
    linear-gradient(150deg, rgba(22, 23, 31, 0.93), rgba(11, 23, 27, 0.9));
}

.casino-card h2 {
  margin: 0;
  color: #ffddb0;
  font-family: "Syne", sans-serif;
}

.casino-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
}

.casino-card-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.casino-info-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 224, 182, 0.42);
  background: rgba(255, 243, 220, 0.08);
  color: #ffe0b2;
  font-weight: 700;
  cursor: pointer;
}

.casino-info-btn:hover {
  background: rgba(255, 243, 220, 0.16);
}

.casino-focus-btn {
  padding: 0.35rem 0.56rem;
  font-size: 0.79rem;
}

.casino-card p {
  color: #c7bfba;
}

.casino-slot-machine {
  margin-top: 0.75rem;
  border: 1px solid rgba(255, 219, 171, 0.24);
  border-radius: 14px;
  padding: 0.8rem;
  background: linear-gradient(145deg, rgba(45, 31, 23, 0.72), rgba(16, 41, 39, 0.68));
}

.slot-reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.slot-reel {
  border-radius: 12px;
  border: 1px solid rgba(255, 227, 190, 0.34);
  background: linear-gradient(160deg, rgba(255, 248, 237, 0.14), rgba(255, 222, 176, 0.07));
  min-height: 88px;
  display: grid;
  place-items: center;
  font-size: clamp(1.7rem, 2.45vw, 2.15rem);
  font-weight: 700;
  color: #ffe7bd;
  letter-spacing: 0.05em;
  text-shadow: 0 0 14px rgba(255, 224, 176, 0.26);
}

.slot-reel.is-spinning {
  animation: slot-spin 220ms linear infinite;
}

@keyframes slot-spin {
  0% {
    transform: translateY(0);
    filter: brightness(0.9);
  }
  50% {
    transform: translateY(-4px);
    filter: brightness(1.08);
  }
  100% {
    transform: translateY(0);
    filter: brightness(0.9);
  }
}

.casino-form {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.62rem;
}

.casino-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
}

.casino-form-actions .btn {
  flex: 1;
  min-width: 130px;
}

.casino-form.is-dealing {
  opacity: 0.92;
}

.casino-form.is-dealing .blackjack-table,
.blackjack-table.is-dealing {
  animation: blackjack-deal-pulse 420ms ease-in-out infinite;
}

@keyframes blackjack-deal-pulse {
  0% {
    filter: brightness(1);
    transform: translateY(0);
  }
  50% {
    filter: brightness(1.08);
    transform: translateY(-2px);
  }
  100% {
    filter: brightness(1);
    transform: translateY(0);
  }
}

.casino-form label {
  display: grid;
  gap: 0.34rem;
  font-size: 0.91rem;
  color: #dfd3c6;
}

.casino-form input,
.casino-form select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 230, 197, 0.28);
  background: rgba(11, 18, 24, 0.66);
  color: var(--text);
  padding: 0.55rem 0.58rem;
  font: inherit;
}

.casino-gain-card {
  margin-top: 0.58rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 227, 186, 0.25);
  background: rgba(11, 18, 24, 0.5);
  padding: 0.5rem 0.58rem;
  display: grid;
  gap: 0.2rem;
}

.casino-gain-card:empty {
  display: none;
}

.casino-gain-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  color: #d4c9bc;
  font-size: 0.88rem;
}

.casino-gain-row strong {
  color: #fff0d5;
}

.casino-gain-row.is-positive strong {
  color: #96f1c8;
}

.casino-gain-row.is-negative strong {
  color: #ff9cab;
}

.roulette-display {
  margin-top: 0.7rem;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.6rem;
  align-items: center;
}

.roulette-wheel {
  width: 110px;
  height: 110px;
  border-radius: 999px;
  border: 2px solid rgba(255, 222, 179, 0.55);
  background:
    conic-gradient(
      #b11f36 0deg 10deg,
      #1d2938 10deg 20deg,
      #b11f36 20deg 30deg,
      #1d2938 30deg 40deg,
      #b11f36 40deg 50deg,
      #1d2938 50deg 60deg,
      #b11f36 60deg 70deg,
      #1d2938 70deg 80deg,
      #b11f36 80deg 90deg,
      #1d2938 90deg 100deg,
      #b11f36 100deg 110deg,
      #1d2938 110deg 120deg,
      #b11f36 120deg 130deg,
      #1d2938 130deg 140deg,
      #b11f36 140deg 150deg,
      #1d2938 150deg 160deg,
      #b11f36 160deg 170deg,
      #1d2938 170deg 180deg,
      #b11f36 180deg 190deg,
      #1d2938 190deg 200deg,
      #b11f36 200deg 210deg,
      #1d2938 210deg 220deg,
      #b11f36 220deg 230deg,
      #1d2938 230deg 240deg,
      #b11f36 240deg 250deg,
      #1d2938 250deg 260deg,
      #b11f36 260deg 270deg,
      #1d2938 270deg 280deg,
      #b11f36 280deg 290deg,
      #1d2938 290deg 300deg,
      #b11f36 300deg 310deg,
      #1d2938 310deg 320deg,
      #b11f36 320deg 330deg,
      #1d2938 330deg 340deg,
      #b11f36 340deg 350deg,
      #1d2938 350deg 360deg
    );
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.roulette-wheel.is-spinning {
  animation: wheel-spin 1s ease;
}

@keyframes wheel-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(1080deg);
  }
}

.roulette-last {
  display: grid;
  gap: 0.25rem;
}

.roulette-last p {
  margin: 0;
}

.roulette-number {
  font-size: 1.8rem;
  color: #ffe1b4;
  font-weight: 700;
}

.roulette-color-red {
  color: #ff7288;
}

.roulette-color-black {
  color: #b0c2d6;
}

.roulette-color-green {
  color: #7ce8a4;
}

.blackjack-table {
  margin-top: 0.72rem;
  border: 1px solid rgba(255, 223, 182, 0.22);
  border-radius: 13px;
  padding: 0.6rem;
  background: linear-gradient(150deg, rgba(18, 46, 41, 0.68), rgba(41, 23, 19, 0.7));
  display: grid;
  gap: 0.5rem;
}

.blackjack-hand {
  display: grid;
  gap: 0.24rem;
}

.blackjack-hand p {
  margin: 0;
  color: #e4ccb0;
  font-size: 0.82rem;
}

.blackjack-hand strong {
  color: #ffe2b4;
}

.blackjack-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.blackjack-card {
  min-width: 30px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 231, 197, 0.35);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.16rem 0.3rem;
  color: #fff4e2;
  font-weight: 700;
}

.casino-bottom-grid {
  display: grid;
  gap: 0.72rem;
  grid-template-columns: 1.35fr 1fr;
}

.casino-grid.has-focused .casino-card {
  opacity: 0.48;
  transform: scale(0.985);
  transition: opacity 180ms ease, transform 180ms ease;
}

.casino-grid.has-focused .casino-card.is-focused {
  opacity: 1;
  transform: scale(1);
  grid-column: span 2;
  border-color: rgba(255, 228, 188, 0.46);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34);
}

.casino-info-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
}

.casino-info-modal.is-hidden {
  display: none;
}

.casino-info-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.74);
  backdrop-filter: blur(2px);
}

.casino-info-panel {
  position: relative;
  width: min(680px, calc(100% - 1.8rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 224, 181, 0.36);
  background: linear-gradient(160deg, rgba(24, 27, 35, 0.96), rgba(12, 25, 30, 0.96));
  padding: 0.95rem;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.52);
}

.casino-info-panel h3 {
  margin: 0;
  color: #ffe4b9;
  font-family: "Syne", sans-serif;
}

.casino-info-content {
  margin: 0.66rem 0 0.8rem;
  color: #e2d4c7;
  display: grid;
  gap: 0.35rem;
}

.casino-info-content p,
.casino-info-content ul {
  margin: 0;
}

.casino-info-content ul {
  padding-left: 1.1rem;
}

.casino-history {
  margin-top: 0.8rem;
  border: 1px solid rgba(255, 224, 183, 0.22);
  border-radius: 12px;
  padding: 0.64rem;
  background: rgba(255, 245, 231, 0.03);
}

.casino-history h3 {
  margin: 0;
  color: #fbd8ac;
  font-size: 1rem;
}

.casino-history-list {
  margin-top: 0.52rem;
  max-height: 170px;
  overflow: auto;
  display: grid;
  gap: 0.38rem;
}

.casino-history-item {
  border: 1px solid rgba(255, 219, 168, 0.2);
  border-radius: 9px;
  padding: 0.42rem 0.52rem;
  background: rgba(255, 255, 255, 0.03);
  color: #ddd4c8;
  font-size: 0.9rem;
}

.casino-history-item strong {
  color: #fff2dd;
}

.casino-ranking-item {
  border: 1px solid rgba(255, 218, 170, 0.22);
  border-radius: 9px;
  padding: 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.025);
  display: grid;
  gap: 0.16rem;
}

.casino-ranking-item p,
.casino-ranking-item span {
  margin: 0;
}

.casino-ranking-item p {
  color: #ffebcc;
}

.casino-ranking-item span {
  color: #cfc3b4;
  font-size: 0.84rem;
}

.casino-ranking-viewer {
  margin-top: 0.56rem;
  border-top: 1px solid rgba(255, 225, 185, 0.2);
  padding-top: 0.48rem;
  display: grid;
  gap: 0.2rem;
}

.casino-ranking-viewer p {
  margin: 0;
  color: #d7cabc;
  font-size: 0.88rem;
}

.casino-reward-item {
  margin-top: 0.6rem;
  border: 1px solid rgba(25, 211, 197, 0.4);
  border-radius: 10px;
  padding: 0.5rem;
  background: linear-gradient(150deg, rgba(25, 211, 197, 0.09), rgba(244, 162, 89, 0.11));
}

.casino-result {
  margin-top: 0.66rem;
}

.casino-page .form-status.error {
  color: #ff9aa8;
}

.casino-page .form-status.success {
  color: #9ef1cf;
}

@media (max-width: 980px) {
  .inventory-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-list-two-cols {
    grid-template-columns: 1fr;
  }

  .inventory-trade-grid {
    grid-template-columns: 1fr;
  }

  .casino-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roulette-display {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .casino-bottom-grid {
    grid-template-columns: 1fr;
  }

  .casino-grid.has-focused .casino-card.is-focused {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .casino-grid {
    grid-template-columns: 1fr;
  }

  .casino-grid.has-focused .casino-card.is-focused {
    grid-column: span 1;
  }

  .inventory-list .inventory-item:not(.market-item) {
    grid-template-columns: 1fr;
  }

  .inventory-list .inventory-item:not(.market-item) .item-illu {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    width: 104px;
    height: 104px;
  }

  .inventory-item-modal-body {
    grid-template-columns: 1fr;
  }
}

.belote-layout {
  align-items: start;
}

.belote-headline {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.belote-score {
  color: #d7e6f4;
  font-weight: 600;
}

.belote-table {
  margin-top: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 0.8rem;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.1), transparent 46%),
    linear-gradient(160deg, #1b5f3f, #12412b);
}

.belote-player-row p {
  margin: 0 0 0.4rem;
  color: #d8ecdf;
}

.belote-opponent-hand,
.belote-hand {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.belote-mid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) minmax(0, 1fr);
  gap: 0.6rem;
  align-items: center;
  margin: 0.75rem 0;
}

.belote-side-player {
  display: grid;
  gap: 0.35rem;
}

.belote-side-player p {
  margin: 0;
  color: #d8ecdf;
}

.belote-trick-zone {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0;
}

.belote-trick-card,
.belote-card {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  min-width: 56px;
  min-height: 74px;
  padding: 0.3rem;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #fffefe, #f0ece2);
  color: #1e2230;
  font-weight: 700;
}

.belote-card {
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.belote-card:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.02);
}

.belote-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.belote-card.back {
  background: linear-gradient(150deg, #123657, #0f2740);
  color: #cce7ff;
  min-width: 44px;
  min-height: 62px;
  font-size: 0.72rem;
}

.belote-card.is-red,
.belote-trick-card.is-red {
  color: #b52235;
}

.belote-card.is-black,
.belote-trick-card.is-black {
  color: #162033;
}

.chess-card h2,
.chess-card h3 {
  margin: 0 0 0.65rem;
  font-family: "Syne", sans-serif;
}

.chess-modes {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.chess-status {
  margin: 0.7rem 0;
  color: #d7e6f4;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.12), transparent 48%),
    linear-gradient(150deg, #3b2a1c, #25180f);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  overflow: hidden;
  max-width: 620px;
  margin-inline: auto;
}

.chess-square {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.chess-square.is-light {
  background: linear-gradient(145deg, #f3dfc2, #e2c89f);
}

.chess-square.is-dark {
  background: linear-gradient(145deg, #bd8b5a, #9d6b3f);
}

.chess-square:hover {
  filter: brightness(1.06);
}

.chess-square.is-selected {
  box-shadow:
    inset 0 0 0 3px rgba(18, 223, 203, 0.95),
    inset 0 0 18px rgba(18, 223, 203, 0.24);
}

.chess-square.is-target {
  box-shadow:
    inset 0 0 0 3px rgba(255, 188, 102, 0.95),
    inset 0 0 18px rgba(255, 188, 102, 0.22);
}

.piece-token {
  width: clamp(34px, 4.8vw, 48px);
  aspect-ratio: 1;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Segoe UI Symbol", "Noto Sans Symbols2", "Arial Unicode MS", sans-serif;
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1;
  user-select: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 6px 14px rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(0, 0, 0, 0.2);
  transition: transform 120ms ease, filter 120ms ease;
}

.piece-token.is-white {
  color: #1f2d3a;
  background: linear-gradient(155deg, #fefefe, #e6edf5 56%, #ccd8e4);
  border-color: #8c98a9;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.piece-token.is-black {
  color: #edf2f8;
  background: linear-gradient(155deg, #4f6278, #2d3b4f 55%, #1a2433);
  border-color: #bdcad9;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.chess-square:hover .piece-token {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.chess-actions {
  margin-top: 0.7rem;
}

.chess-meta p {
  margin: 0.25rem 0;
  color: #d4e2f0;
}

.elo-panel {
  margin-bottom: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  background: rgba(255, 255, 255, 0.04);
}

.elo-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.elo-panel h3 {
  margin: 0.25rem 0 0.55rem;
  font-size: 1.5rem;
}

.elo-best-player {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.elo-best-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  background-position: center;
  background-size: cover;
}

.elo-best-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.elo-best-player p {
  margin: 0;
  color: #d5e6f5;
}

.form-status {
  margin: 0.75rem 0 0;
  min-height: 1.2rem;
  color: var(--muted);
}

.form-status.error {
  color: #ff91a0;
}

.form-status.success {
  color: #89f0ca;
}

.game-launch-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 40;
}

.game-launch-modal.is-open {
  display: block;
}

.game-launch-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 11, 18, 0.72);
}

.game-launch-card {
  position: relative;
  width: min(920px, calc(100vw - 1.4rem));
  margin: 7vh auto 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(20, 42, 62, 0.98), rgba(11, 26, 37, 0.96));
  padding: 0.9rem;
}

.game-launch-grid {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 0.9rem;
}

.game-launch-actions {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.game-launch-actions .btn {
  width: 100%;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 680ms ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 120ms;
}

.reveal:nth-child(3) {
  animation-delay: 220ms;
}

.reveal:nth-child(4) {
  animation-delay: 320ms;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 940px) {
  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-layout {
    grid-template-columns: 1fr;
  }

  .wallet-grid {
    grid-template-columns: 1fr;
  }

  .wallet-inline-grid {
    grid-template-columns: 1fr;
  }

  .tournaments-grid {
    grid-template-columns: 1fr;
  }

  .wallet-history {
    grid-column: auto;
  }

  .chess-layout {
    grid-template-columns: 1fr;
  }

  .game-launch-grid {
    grid-template-columns: 1fr;
  }

  .belote-trick-zone {
    grid-template-columns: 1fr;
  }

  .belote-mid-row {
    grid-template-columns: 1fr;
  }

  .market-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .chat-body {
    grid-template-columns: 1fr;
  }

  .chat-friends {
    border-right: none;
    border-bottom: 1px solid var(--line);
    max-height: 150px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 0.8rem;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .btn {
    flex: 1;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .user-zone {
    width: 100%;
    justify-content: space-between;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .presence-drawer {
    --presence-drawer-width: 220px;
    top: auto;
    bottom: 20px;
  }

  .presence-content {
    width: 176px;
  }

  .market-toolbar {
    grid-template-columns: 1fr;
  }

  .market-item {
    grid-template-columns: 1fr;
  }

  .market-price {
    text-align: left;
  }

  .chat-bubble {
    right: 12px;
    bottom: 12px;
  }

  .chat-panel {
    right: 10px;
    left: 10px;
    width: auto;
    height: min(78vh, calc(100vh - 90px));
    bottom: 64px;
  }
}

/* ═══════════════════════════════════════════════════════════
   RPG PAGE
   ═══════════════════════════════════════════════════════════ */
.rpg-page {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px circle at 18% 12%, rgba(104, 181, 255, 0.25), transparent 56%),
    radial-gradient(1100px circle at 85% 80%, rgba(255, 239, 153, 0.2), transparent 52%),
    linear-gradient(165deg, #5aa0dc, #76c36e 52%, #4f93d0);
  overflow: hidden;
  height: 100vh;
}
.rpg-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#rpg-canvas {
  border: 4px solid #fff6db;
  border-radius: 20px;
  box-shadow: 0 26px 50px rgba(25, 44, 66, 0.35), inset 0 0 0 2px rgba(0, 0, 0, 0.16);
  background: #17395a;
  image-rendering: pixelated;
}
.rpg-battle-transition {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0) 0%, rgba(8, 20, 32, 0.2) 30%, rgba(7, 15, 24, 0.94) 100%),
    repeating-radial-gradient(circle at center, rgba(255, 255, 255, 0.16) 0 8px, rgba(11, 26, 39, 0.2) 9px 16px);
  z-index: 40;
}
.rpg-battle-transition.is-active {
  animation: rpgBattleIris 420ms cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
@keyframes rpgBattleIris {
  0% {
    opacity: 0;
    transform: scale(1.06);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}
.rpg-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  align-items: center;
  background: linear-gradient(160deg, rgba(13, 39, 61, 0.9), rgba(24, 60, 86, 0.84));
  border: 2px solid rgba(255, 245, 214, 0.68);
  border-radius: 18px;
  padding: 8px 14px;
  z-index: 10;
}
.rpg-trainer-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
}
.rpg-trainer-chip img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #fff8dd;
  object-fit: cover;
  background: linear-gradient(140deg, #224668, #4778a3);
}
.rpg-trainer-chip span {
  color: #fff6d8;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
}
.rpg-hud-team {
  display: flex;
  gap: 6px;
}
.rpg-hud-mon {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.3);
}
.rpg-hud-mon.is-active {
  border-color: #ffe07a;
  box-shadow: 0 0 9px rgba(255, 224, 122, 0.6);
}
.rpg-hud-mon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.rpg-hud-mon-hp {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 6px 6px;
  transition: width 0.3s;
}
.rpg-hud-zone, .rpg-hud-balance {
  color: #eef5ff;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}
.rpg-hud-balance { color: #ffe176; }
.rpg-keyhints {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 248, 214, 0.82);
  background: rgba(15, 40, 59, 0.48);
  border: 1px solid rgba(255, 244, 196, 0.38);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-family: 'Chakra Petch', sans-serif;
}

/* Overlays */
.rpg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 20, 32, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.rpg-overlay.is-hidden { display: none; }
.rpg-panel {
  background: linear-gradient(165deg, rgba(24, 58, 86, 0.96), rgba(16, 40, 62, 0.94));
  border: 2px solid rgba(255, 243, 200, 0.54);
  border-radius: 20px;
  padding: 1.2rem 1.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  color: #c9dbe8;
  font-family: 'Chakra Petch', sans-serif;
}
.rpg-panel h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.22rem;
  color: #fff7dc;
  margin: 0 0 0.8rem;
}

/* Combat scene */
.rpg-combat-scene {
  width: 90%;
  max-width: 700px;
  background:
    linear-gradient(180deg, rgba(119, 193, 108, 0.96) 0%, rgba(105, 179, 230, 0.94) 100%);
  border: 3px solid #fff6db;
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(9, 28, 45, 0.35), inset 0 0 0 2px rgba(9, 36, 56, 0.2);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.rpg-combat-top, .rpg-combat-bottom {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.rpg-combat-top {
  justify-content: flex-end;
}
.rpg-combat-bottom {
  justify-content: flex-start;
}
.rpg-combat-sprite {
  width: 116px;
  height: 116px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.38));
}
.rpg-sprite-flip { transform: scaleX(-1); }
.rpg-combat-enemy-info, .rpg-combat-player-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rpg-combat-label {
  color: #132d43;
  font-weight: 800;
  font-size: 0.92rem;
}
.rpg-hp-bar {
  width: 100%;
  height: 10px;
  background: rgba(21, 44, 64, 0.18);
  border-radius: 4px;
  overflow: hidden;
}
.rpg-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #52cd78, #2aa457);
  border-radius: 4px;
  transition: width 0.4s;
}
.rpg-hp-fill-player { background: linear-gradient(90deg, #58a7df, #2f78bb); }
.rpg-hp-text {
  font-size: 0.72rem;
  color: rgba(18, 46, 70, 0.75);
  font-weight: 700;
}
.rpg-xp-bar {
  width: 100%;
  height: 6px;
  background: rgba(19, 43, 65, 0.14);
  border-radius: 3px;
  overflow: hidden;
}
.rpg-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #7db0ea, #5077d0);
  border-radius: 3px;
  transition: width 0.4s;
}

/* Combat actions */
.rpg-combat-actions {
  width: 90%;
  max-width: 700px;
  margin-top: 0.5rem;
}
.rpg-combat-moves {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}
.rpg-move-btn {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(237, 245, 253, 0.94));
  border: 2px solid #7895ad;
  border-radius: 12px;
  padding: 8px 10px;
  color: #173247;
  cursor: pointer;
  text-align: left;
  font-family: 'Chakra Petch', sans-serif;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.rpg-move-btn:hover:not([disabled]) {
  background: linear-gradient(165deg, rgba(255, 255, 255, 1), rgba(226, 240, 253, 0.98));
  transform: translateY(-1px);
  box-shadow: 0 10px 14px rgba(18, 53, 82, 0.15);
}
.rpg-move-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.rpg-move-name { font-weight: 600; font-size: 0.85rem; display: block; }
.rpg-move-info { font-size: 0.65rem; color: rgba(26, 67, 98, 0.72); }
.rpg-combat-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rpg-btn {
  font-size: 0.8rem !important;
  padding: 6px 14px !important;
}
.rpg-combat-log {
  width: 90%;
  max-width: 700px;
  margin-top: 6px;
  background:
    linear-gradient(160deg, rgba(14, 36, 55, 0.9), rgba(16, 41, 62, 0.86)),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) 2px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0) 4px
    );
  border-radius: 12px;
  border: 2px solid rgba(255, 245, 206, 0.62);
  box-shadow: inset 0 0 0 2px rgba(255, 244, 194, 0.1);
  padding: 6px 10px;
  max-height: 80px;
  overflow-y: auto;
}
.rpg-combat-log p {
  margin: 2px 0;
  font-size: 0.75rem;
  color: #f0f7ff;
  font-family: 'Chakra Petch', sans-serif;
}

.rpg-combat-sprite.is-capture-pulse {
  animation: rpgCapturePulse 360ms ease-out 2;
}
@keyframes rpgCapturePulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.38));
  }
  50% {
    transform: scale(1.12);
    filter: drop-shadow(0 0 12px rgba(166, 229, 255, 0.9));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 8px 8px rgba(0, 0, 0, 0.38));
  }
}

/* Shop */
.rpg-shop-bal {
  color: #ffe176;
  font-weight: 600;
  margin-bottom: 0.6rem;
}
.rpg-shop-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rpg-shop-tab {
  border: 1px solid rgba(255, 243, 208, 0.48);
  background: rgba(22, 52, 75, 0.72);
  color: #dbeafe;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}
.rpg-shop-tab.is-active {
  background: linear-gradient(160deg, #ffefaf, #ffd876);
  color: #183043;
  border-color: rgba(255, 247, 220, 0.96);
}
.rpg-shop-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}
.rpg-shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: linear-gradient(165deg, rgba(24, 60, 87, 0.78), rgba(18, 44, 66, 0.72));
  border-radius: 10px;
  border: 1px solid rgba(255, 245, 206, 0.26);
}
.rpg-shop-icon { font-size: 1.4rem; }
.rpg-shop-item-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rpg-shop-item-info strong { color: #fff7de; font-size: 0.85rem; }
.rpg-shop-item-info span { font-size: 0.7rem; color: rgba(227, 241, 255, 0.8); }
.rpg-shop-price { color: #ffd700; font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.rpg-shop-buy-btn { font-size: 0.75rem !important; padding: 4px 12px !important; }

/* List rows (items, capture, switch) */
.rpg-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 6px;
  color: #c9dbe8;
  font-size: 0.82rem;
}
.rpg-list-row.is-ko { opacity: 0.4; }
.rpg-list-row img { border-radius: 6px; }
.rpg-empty {
  color: rgba(255,255,255,0.4);
  font-size: 0.82rem;
  text-align: center;
  padding: 1rem 0;
}

/* Starter */
.rpg-starter-panel { max-width: 700px; }
.rpg-starter-choices {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.rpg-starter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px;
  background: linear-gradient(165deg, rgba(23, 58, 84, 0.75), rgba(15, 42, 63, 0.73));
  border: 1px solid rgba(255, 245, 204, 0.28);
  border-radius: 12px;
  width: 120px;
}
.rpg-starter-card img { image-rendering: pixelated; }
.rpg-starter-card strong { color: #fff; font-size: 0.9rem; }
.rpg-starter-card span { font-size: 0.65rem; color: rgba(255,255,255,0.5); }
.rpg-starter-btn { margin-top: 4px; font-size: 0.75rem !important; padding: 4px 12px !important; }

/* Team view */
.rpg-team-panel { max-width: 650px; }
.rpg-team-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1rem;
}
.rpg-team-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
}
.rpg-team-card.is-ko { opacity: 0.4; }
.rpg-team-card img { image-rendering: pixelated; border-radius: 8px; }
.rpg-team-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.78rem;
  color: #c9dbe8;
}
.rpg-team-card-info strong { color: #fff; font-size: 0.95rem; }
.rpg-team-moves { font-size: 0.7rem; color: rgba(255,255,255,0.4); }
.rpg-team-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}
.rpg-team-item-btn {
  font-size: 0.68rem !important;
  padding: 3px 8px !important;
}
.rpg-team-action-empty {
  font-size: 0.66rem;
  color: rgba(255,255,255,0.45);
}
.rpg-team-select-btn {
  margin-top: 0.35rem;
  align-self: flex-start;
  font-size: 0.72rem !important;
  padding: 4px 10px !important;
}
.rpg-type-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
}

/* Glumonster tab in inventory */
.glumonster-inventory-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.glumonster-inventory-card:hover { background: rgba(255,255,255,0.08); }
.glumonster-inventory-card.is-ko { opacity: 0.45; }
.glumonster-inventory-card img {
  width: 56px;
  height: 56px;
  image-rendering: pixelated;
  border-radius: 8px;
}
.glumonster-inventory-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.glumonster-inventory-info strong { color: #fff; font-size: 0.88rem; }
.glumonster-inventory-info span { font-size: 0.72rem; color: rgba(255,255,255,0.5); }
.gludex-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gludex-actions {
  justify-content: flex-start;
  margin-bottom: 6px;
}
.gludex-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
  color: rgba(240, 248, 255, 0.92);
}
.gludex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.gludex-card {
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  text-align: center;
}
.gludex-card img {
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
}
.gludex-card p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: rgba(240, 248, 255, 0.8);
}
.gludex-card.is-unknown img {
  filter: grayscale(1) brightness(0.2);
}
.gludex-card.is-unknown p {
  color: rgba(255, 255, 255, 0.45);
}
.glumonster-detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.glumonster-detail-modal.is-hidden { display: none; }
.glumonster-detail-card {
  background: linear-gradient(150deg, rgba(19,41,61,0.96), rgba(13,31,44,0.92));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 1.2rem;
  max-width: 400px;
  width: 90%;
  color: #c9dbe8;
  font-family: 'Chakra Petch', sans-serif;
  text-align: center;
}
.glumonster-detail-card img {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  margin-bottom: 0.5rem;
}
.glumonster-detail-card h3 { color: #fff; margin: 0 0 0.4rem; }
.glumonster-detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  font-size: 0.78rem;
  text-align: left;
  margin: 0.6rem 0;
}

@media (max-width: 900px) {
  .arena-grid {
    grid-template-columns: 1fr;
  }

  #rpg-canvas {
    width: min(96vw, 960px);
    height: auto;
  }

  .rpg-hud {
    width: min(96vw, 940px);
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
  }

  .rpg-trainer-chip span {
    display: none;
  }

  .rpg-combat-moves {
    grid-template-columns: 1fr;
  }

  .rpg-combat-sprite {
    width: 84px;
    height: 84px;
  }
}
