:root {
  --yellow-paper: #FCE566;
  --yellow-line: #F0D348;
  --ink: #181818;
  --cream: #FAF4D0;
  --forest: #2E473B;
  --red: #DC352E;
  --sumatra: #E74C3C;
  --kalimantan: #F3A678;
  --sulawesi: #7CC889;
  --papua: #3B8CE6;
  --jawa: #8E5DC2;
  --takdir-blue: #2E9CE6;
  --musibah-red: #D63329;
  --musibah-orange: #E85D2A;
  --tier-s1: #D9EFE0;
  --tier-s2: #B2DFC2;
  --tier-okb: #EB6FA3;
  --bekasi: #6D4C9E;
  --shadow-comic: 4px 4px 0 #181818;
  --shadow-sm: 2.5px 2.5px 0 #181818;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background-color: var(--yellow-paper);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--yellow-paper) 0px,
    var(--yellow-paper) 13px,
    var(--yellow-line) 13px,
    var(--yellow-line) 14.5px
  );
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.ico {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  stroke-width: 2.5;
  flex-shrink: 0;
  display: inline-block;
}

.ico-xs {
  width: 13px;
  height: 13px;
  vertical-align: -2px;
  stroke-width: 2.5;
  flex-shrink: 0;
  display: inline-block;
}

.ico-lg {
  width: 22px;
  height: 22px;
  vertical-align: -5px;
  stroke-width: 2.5;
  flex-shrink: 0;
  display: inline-block;
}

.screen {
  min-height: 100vh;
}

/* =========================================
   BUTTONS & COMIC PRIMITIVES
========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 800;
  color: var(--ink);
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 9px 15px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.12s ease;
  user-select: none;
}

.btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-red {
  background: var(--red);
  color: #FFFFFF;
}

.btn-green {
  background: #5DB467;
  color: #FFFFFF;
}

.btn-forest {
  background: var(--forest);
  color: #FFFFFF;
}

.btn-yellow {
  background: var(--yellow-paper);
  color: var(--ink);
}

.btn-cream {
  background: var(--cream);
  color: var(--ink);
}

.btn-purple {
  background: var(--bekasi);
  color: #FFFFFF;
}

.btn-blue {
  background: var(--takdir-blue);
  color: #FFFFFF;
}

.btn-outline {
  background: #FFFFFF;
  color: var(--ink);
}

.btn-lg {
  font-size: 1rem;
  padding: 12px 20px;
  border-radius: 12px;
}

.btn-sm {
  font-size: 0.84rem;
  padding: 7px 12px;
}

.btn-xs {
  font-size: 0.78rem;
  padding: 5px 10px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.comic-card {
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
}

/* =========================================
   SCREEN 1: LOBBY
========================================= */
.screen-lobby {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px 48px;
  overflow: hidden;
}

.lobby-road-stripe {
  position: fixed;
  left: -10%;
  bottom: 24px;
  width: 120%;
  height: 44px;
  background: var(--red);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(-2deg);
  pointer-events: none;
  z-index: 0;
  opacity: 0.92;
}

.lobby-road-stripe::after {
  content: '';
  position: absolute;
  inset: 0;
  top: 19px;
  height: 6px;
  background: repeating-linear-gradient(
    to right,
    #FFFFFF 0 28px,
    transparent 28px 50px
  );
}

.lobby-hero {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
  margin-bottom: 18px;
}

.lobby-logo-stack {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.mini-square-badge {
  background: var(--yellow-paper);
  border: 4px solid var(--red);
  outline: 2.5px solid var(--ink);
  padding: 5px 8px;
  text-align: center;
  line-height: 0.92;
  font-family: 'Space Grotesk', sans-serif;
  box-shadow: var(--shadow-sm);
}

.mini-square-badge span {
  display: block;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.mini-square-badge strong {
  font-size: 0.95rem;
  font-weight: 900;
}

.slanted-banner {
  background: #FFFFFF;
  border: 3.5px solid var(--ink);
  padding: 8px 22px;
  transform: rotate(-1.5deg);
  box-shadow: 5px 5px 0 var(--ink);
}

.slanted-banner h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.7rem, 4.5vw, 2.75rem);
  font-weight: 900;
  color: var(--red);
  letter-spacing: -0.5px;
}

.hh-circle-pill {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 3px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-style: italic;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.lobby-subtitle {
  margin-top: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  background: rgba(250, 244, 208, 0.85);
  display: inline-block;
  padding: 5px 14px;
  border-radius: 99px;
  border: 2px solid var(--ink);
}

.hero-pills {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.hero-pill {
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 99px;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 800;
}

.lobby-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
}

.lobby-card {
  padding: 20px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.mode-tab {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.94rem;
  padding: 11px 10px;
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.mode-tab.active {
  background: var(--forest);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.setup-section {
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.form-group {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group-sm {
  flex: 0 1 210px;
}

label, .section-label {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.section-label {
  display: block;
  margin-bottom: 8px;
}

input[type="text"], select {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
}

input[type="text"]:focus, select:focus {
  outline: none;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(220, 53, 46, 0.25);
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.char-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 10px 6px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.char-option:hover {
  transform: translateY(-2px);
}

.char-option.selected {
  background: var(--yellow-paper);
  box-shadow: var(--shadow-comic);
  transform: translate(-1px, -3px);
}

.char-option svg {
  width: 58px;
  height: 58px;
}

.char-option strong {
  font-size: 0.9rem;
  font-weight: 900;
}

.char-option span {
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0.82;
}

.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

.online-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sub-box {
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 16px;
}

.sub-box h3 {
  font-size: 1.05rem;
  font-weight: 900;
  margin-bottom: 6px;
}

.sub-box p {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.join-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.join-input-row input {
  flex: 1;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 2px;
}

.ws-status {
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0 !important;
}

.ws-status.online { color: #1E8449; }
.ws-status.offline { color: var(--red); }

.hotseat-names-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

/* Room Waiting Lobby */
.room-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2.5px dashed var(--ink);
  margin-bottom: 16px;
}

.badge-tag {
  display: inline-block;
  background: var(--forest);
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.6px;
}

.room-code-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 900;
  margin-top: 4px;
}

.room-code-title span {
  color: var(--red);
  letter-spacing: 3px;
}

.room-header-btns {
  display: flex;
  gap: 8px;
}

.room-body-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 16px;
}

.room-slots-col, .room-chat-col {
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.slots-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.room-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.room-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 10px;
}

.room-member-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-member-left svg {
  width: 38px;
  height: 38px;
}

.room-member-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 800;
  border: 2px solid var(--ink);
}

.pill-dark { background: var(--ink); color: var(--yellow-paper); }
.pill-cream { background: var(--cream); color: var(--ink); }
.pill-green { background: #5DB467; color: #FFFFFF; }
.pill-red { background: var(--red); color: #FFFFFF; }
.pill-purple { background: var(--bekasi); color: #FFFFFF; }

.room-char-switcher {
  margin-top: auto;
  padding-top: 10px;
  border-top: 2px dashed #CCC;
  margin-bottom: 12px;
}

.room-char-pills {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.char-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.char-mini-btn.mine {
  background: var(--yellow-paper);
  box-shadow: var(--shadow-sm);
}

.char-mini-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.room-footer-actions {
  display: flex;
  gap: 10px;
}

.room-footer-actions .btn {
  flex: 1;
}

.chat-feed {
  flex: 1;
  min-height: 170px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-item {
  font-size: 0.82rem;
  line-height: 1.35;
  background: #FFFFFF;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1.5px solid #D5CFA8;
}

.chat-item strong {
  color: var(--forest);
}

.chat-form {
  display: flex;
  gap: 6px;
}

.chat-form input {
  flex: 1;
  padding: 7px 10px;
  font-size: 0.85rem;
}

/* =========================================
   SCREEN 2: GAME WORKSPACE
========================================= */
.screen-game {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-topbar {
  height: 54px;
  flex: 0 0 54px;
  background: var(--forest);
  color: #FFFFFF;
  border-bottom: 3.5px solid var(--ink);
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 20;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  background: var(--red);
  color: #FFFFFF;
  padding: 4px 10px;
  border: 2px solid #FFFFFF;
  border-radius: 7px;
  letter-spacing: 0.4px;
}

.topbar-brand span {
  color: var(--yellow-paper);
  margin-left: 3px;
}

.turn-banner {
  background: var(--yellow-paper);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 99px;
  padding: 4px 16px;
  font-weight: 900;
  font-size: 0.88rem;
  box-shadow: 2px 2px 0 #000;
  white-space: nowrap;
}

.game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 270px 1fr 315px;
  min-height: 0;
  overflow: hidden;
}

.game-col {
  background: rgba(250, 244, 208, 0.96);
  border-right: 3px solid var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}

.col-right {
  border-right: none;
  border-left: 3px solid var(--ink);
}

.panel-header {
  padding: 10px 12px;
  border-bottom: 2.5px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header.forest {
  background: var(--forest);
  color: #FFFFFF;
}

.panel-header.cream-sub {
  background: var(--yellow-paper);
  padding: 7px 12px;
}

.panel-header h3, .panel-header h4 {
  font-size: 0.92rem;
  font-weight: 900;
}

.panel-sub {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.85;
}

.players-roster {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.player-card {
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 8px 10px;
  transition: transform 0.12s ease;
}

.player-card.active-turn {
  background: #FFF9D6;
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-1px, -1px);
  border-color: var(--red);
}

.player-card.bankrupt {
  opacity: 0.55;
  background: #ECECEC;
}

.pcard-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pcard-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
}

.pcard-meta {
  flex: 1;
  min-width: 0;
}

.pcard-name {
  font-weight: 900;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pcard-cash {
  font-weight: 900;
  font-size: 0.96rem;
  color: #1E8449;
}

.pcard-cash.negative {
  color: var(--red);
}

.pcard-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.mini-tag {
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 2px 6px;
}

.mini-tag.danger { background: #FADBD8; color: #922B21; }
.mini-tag.purple { background: #E8DAEF; color: #4A235A; }
.mini-tag.blue { background: #D6EAF8; color: #1B4F72; }

.island-legend {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 5px 8px;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--ink);
  display: inline-block;
  margin-right: 6px;
}

/* Center Stage & Board */
.game-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 0;
  padding: 8px 10px 10px;
  overflow: hidden;
}

.board-stage {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.board-container {
  width: min(100%, calc(100vh - 155px));
  aspect-ratio: 1 / 1;
  max-width: 780px;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wni-board-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22));
}

.board-tile:hover > path:first-child {
  filter: brightness(1.06);
}

.pawn-pulse {
  animation: pawnPulse 1.3s infinite ease-in-out;
}

@keyframes pawnPulse {
  0%, 100% { stroke-opacity: 0.95; transform: scale(1); }
  50% { stroke-opacity: 0.25; transform: scale(1.16); }
}

.board-pawn.just-moved {
  animation: pawnHop 0.35s ease;
}

@keyframes pawnHop {
  0% { filter: drop-shadow(0 0 8px #FCE566); }
  100% { filter: none; }
}

/* Floating Action & Dice Dock */
.action-dock {
  width: 100%;
  max-width: 780px;
  background: var(--cream);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: var(--shadow-comic);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dice-tray {
  display: flex;
  gap: 6px;
}

.die-cube {
  width: 40px;
  height: 40px;
  background: var(--forest);
  color: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.die-cube.rolling {
  animation: diceShake 0.4s ease;
}

@keyframes diceShake {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-16deg) scale(1.12); }
  50% { transform: rotate(14deg) scale(1.15); }
  75% { transform: rotate(-10deg) scale(1.08); }
  100% { transform: rotate(0deg) scale(1); }
}

.dock-status {
  flex: 1;
  min-width: 160px;
}

.dock-event-text {
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.3;
}

.dock-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Right Panel */
.decision-card-box {
  padding: 10px;
  background: var(--yellow-paper);
  border-bottom: 3px solid var(--ink);
}

.decision-box-inner {
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
}

.decision-box-inner h4 {
  font-size: 0.9rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.decision-box-inner p {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.35;
}

.right-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2.5px solid var(--ink);
}

.right-tab {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 9px 8px;
  border: none;
  background: var(--cream);
  cursor: pointer;
  border-right: 2px solid var(--ink);
}

.right-tab:last-child { border-right: none; }

.right-tab.active {
  background: var(--forest);
  color: #FFFFFF;
}

.rpanel {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding: 8px 10px;
  overflow-y: auto;
}

.rpanel.active {
  display: flex;
}

.emote-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.emote-btn {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  background: #FFFFFF;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  padding: 3px 7px;
  cursor: pointer;
}

.emote-btn:hover { background: var(--yellow-paper); }

.game-chat-feed {
  flex: 1;
  max-height: none;
  min-height: 160px;
  margin: 4px 0 8px;
}

.log-feed {
  max-height: 54vh;
  min-height: 200px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-entry {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  border-bottom: 1px dashed #E2DCBE;
  padding-bottom: 4px;
}

.assets-inspector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.asset-row-card {
  background: #FFFFFF;
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.asset-row-head {
  color: #FFFFFF;
  padding: 5px 9px;
  font-weight: 900;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  text-shadow: 1px 1px 0 #181818;
}

.asset-row-body {
  padding: 6px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================================
   AUTHENTIC KARTU PROPERTI / TAKDIR / MUSIBAH MODALS
========================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 22, 20, 0.68);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-dialog {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  animation: popIn 0.16s ease-out;
}

.modal-dialog.wide {
  max-width: 680px;
}

@keyframes popIn {
  from { transform: scale(0.92) translateY(8px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* Official Kartu Properti Design */
.kartu-properti {
  background: #FFFFFF;
  border: 4px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 7px 7px 0 var(--ink);
}

.kp-header {
  padding: 14px 18px;
  color: #FFFFFF;
  text-align: center;
  border-bottom: 3px solid var(--ink);
}

.kp-region {
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  opacity: 0.95;
}

.kp-city {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.85rem;
  font-weight: 900;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.45);
}

.kp-body {
  padding: 14px 16px;
}

.kp-price-row {
  display: flex;
  justify-content: space-between;
  font-weight: 900;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.kp-sewa-title {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.kp-tiers {
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.kp-tier-row {
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
  font-weight: 800;
  font-size: 0.88rem;
  border-bottom: 1.5px solid #D5D5D5;
}

.kp-tier-row:last-child { border-bottom: none; }
.kp-tier-row.tier-0 { background: #FFFFFF; }
.kp-tier-row.tier-1 { background: var(--tier-s1); }
.kp-tier-row.tier-2 { background: var(--tier-s2); }
.kp-tier-row.tier-3 { background: var(--tier-okb); color: #181818; }
.kp-tier-row.is-current { outline: 2.5px solid var(--ink); outline-offset: -2px; }

.kp-footer {
  display: flex;
  justify-content: space-between;
  font-weight: 900;
  font-size: 0.9rem;
  padding-top: 8px;
  border-top: 2px dashed var(--ink);
  margin-bottom: 12px;
}

/* Official Kartu Takdir & Kartu Musibah */
.kartu-takdir {
  background: radial-gradient(circle at 50% 25%, #64C0FF 0%, var(--takdir-blue) 70%);
  color: #FFFFFF;
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 7px 7px 0 var(--ink);
}

.kartu-musibah {
  background: radial-gradient(circle at 80% 15%, #E85D2A 0%, var(--musibah-red) 65%);
  color: #FFFFFF;
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 7px 7px 0 var(--ink);
}

.card-badge-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-wni-stamp {
  border: 2.5px solid #FFFFFF;
  padding: 3px 7px;
  font-size: 0.7rem;
  font-weight: 900;
  border-radius: 4px;
}

.card-big-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.card-desc-text {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 14px;
}

.musibah-table {
  background: rgba(0, 0, 0, 0.22);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 14px;
}

.musibah-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.45);
}

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

.musibah-roll-col {
  background: rgba(255, 255, 255, 0.16);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.45);
}

.musibah-text-col {
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
}

.card-quote {
  font-style: italic;
  font-size: 0.84rem;
  opacity: 0.95;
  margin-bottom: 16px;
}

.modal-cream {
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 7px 7px 0 var(--ink);
}

.modal-forest {
  background: var(--forest);
  color: #FFFFFF;
  border: 4px solid var(--ink);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 7px 7px 0 var(--ink);
}

.rulebook-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.rulebook-box {
  background: var(--cream);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.rulebook-box h4 {
  font-size: 0.9rem;
  font-weight: 900;
  margin-bottom: 4px;
  color: var(--red);
}

/* Toasts & Floating Emotes */
.toast-container {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  width: min(92vw, 440px);
}

.toast {
  background: var(--ink);
  color: var(--yellow-paper);
  border: 2.5px solid #FFFFFF;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

.emote-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 180;
}

.floating-emote {
  position: absolute;
  bottom: 90px;
  right: 22px;
  background: #FFFFFF;
  border: 3px solid var(--ink);
  border-radius: 99px;
  padding: 6px 14px;
  font-weight: 900;
  box-shadow: var(--shadow-comic);
  animation: floatUp 2.1s ease-out forwards;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  15% { transform: translateY(-14px) scale(1.06); opacity: 1; }
  85% { transform: translateY(-90px) scale(1); opacity: 1; }
  100% { transform: translateY(-130px) scale(0.92); opacity: 0; }
}

.mobile-nav {
  display: none;
}

/* =========================================
   RESPONSIVE MOBILE (< 960px)
========================================= */
@media (max-width: 960px) {
  .game-layout {
    grid-template-columns: 1fr;
    position: relative;
  }

  .game-col {
    display: none;
    position: fixed;
    top: 54px;
    left: 0;
    right: 0;
    bottom: 54px;
    z-index: 40;
    border: none;
  }

  .game-col.mobile-open {
    display: flex;
  }

  .board-container {
    width: min(96vw, calc(100vh - 205px));
  }

  .mobile-nav {
    height: 54px;
    flex: 0 0 54px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--forest);
    border-top: 3px solid var(--ink);
    z-index: 50;
  }

  .mnav-btn {
    font-family: inherit;
    font-weight: 800;
    font-size: 0.78rem;
    background: transparent;
    color: #FFFFFF;
    border: none;
    border-right: 1.5px solid rgba(255,255,255,0.2);
    cursor: pointer;
  }

  .mnav-btn.active {
    background: var(--yellow-paper);
    color: var(--ink);
  }
}

@media (max-width: 680px) {
  .char-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .online-actions-grid, .room-body-grid, .rulebook-grid {
    grid-template-columns: 1fr;
  }
  .mode-tabs {
    grid-template-columns: 1fr;
  }
  .topbar-brand { font-size: 0.82rem; padding: 3px 6px; }
  .turn-banner { font-size: 0.74rem; padding: 3px 10px; }
}
