.hidden { display: none !important; }

.mine-page {
  background:
    radial-gradient(38rem 24rem at 12% -6%, rgba(255, 184, 77, 0.12), transparent 64%),
    radial-gradient(34rem 22rem at 94% 8%, rgba(139, 123, 255, 0.08), transparent 64%),
    radial-gradient(30rem 22rem at 80% 92%, rgba(77, 148, 255, 0.07), transparent 62%),
    linear-gradient(180deg, #070b16 0%, #05080f 46%, #04060d 100%);
  color: #eef3fa;
  min-height: 100vh;
}

.mine-shell {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.mine-header {
  max-width: 760px;
  margin: 0 auto 18px;
  color: #cbb991;
}

.mine-header .back-link,
.mine-header .path { color: #cbb991; }

.mine-header .game-toolbar {
  background: rgba(224, 181, 102, 0.08);
  border: 1px solid rgba(224, 181, 102, 0.22);
}

.mine-header .game-toolbar a { color: #cbb991; }

.mine-header .game-toolbar a:hover {
  background: rgba(224, 181, 102, 0.16);
  color: #f6ead3;
}

.mine-panel {
  background:
    radial-gradient(22rem 12rem at 100% -20%, rgba(255, 184, 77, 0.06), transparent 70%),
    #0b1220;
  border: 1px solid rgba(255, 184, 77, 0.2);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(2, 6, 14, 0.55);
  padding: 28px;
}

.mine-narrow {
  width: min(760px, 100%);
  margin: 0 auto;
}

.mine-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 70px 30px;
  text-align: center;
  color: rgba(224, 181, 102, 0.75);
  font-size: 13.5px;
}

.mine-loading-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(224, 181, 102, 0.25);
  border-top-color: #e0b566;
  animation: mineSpin 0.8s linear infinite;
}

@keyframes mineSpin { to { transform: rotate(360deg); } }

.mine-title-lockup,
.mine-userbar,
.mine-room-top,
.mine-room-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mine-title-lockup { justify-content: flex-start; margin-bottom: 18px; }
.mine-title-lockup.compact { margin-top: 24px; }

.mine-logo {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #24180d;
  background: linear-gradient(145deg, #ffd36e, #c48128);
  font-size: 34px;
  box-shadow: 0 10px 30px rgba(196, 129, 40, 0.28);
}

.mine-title-lockup h1,
.mine-room-code {
  margin: 0;
  color: #f4f7fc;
  line-height: 1;
  font-size: clamp(28px, 5vw, 44px);
}

.mine-kicker {
  color: #d7a952;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 11px;
  font-weight: 800;
  margin: 0 0 5px;
}

.mine-lead {
  color: #a9b6cb;
  font-size: 15px;
  margin: 0 0 24px;
}

.mine-lead.small { font-size: 13px; }

.mine-page .auth-tabs {
  border-bottom: 1px solid rgba(224, 181, 102, 0.2);
  margin-bottom: 16px;
}

.mine-page .auth-tab {
  background: none;
  border: 0;
  color: #9f917e;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.mine-page .auth-tab.active {
  color: #ffd36e;
  border-bottom: 2px solid #e1a846;
}

.mine-page .auth-form {
  display: grid;
  gap: 10px;
}

.mine-page input {
  width: 100%;
  border: 1px solid rgba(224, 181, 102, 0.24);
  border-radius: 10px;
  background: rgba(10, 8, 6, 0.42);
  color: #fff7e8;
  padding: 12px 13px;
  font: inherit;
  outline: none;
}

.mine-page input:focus {
  border-color: #d9a441;
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.12);
}

.mine-primary,
.mine-secondary {
  border-radius: 10px;
  padding: 11px 16px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.mine-primary {
  background: linear-gradient(145deg, #efbd57, #bd7725);
  color: #23170c;
  box-shadow: 0 8px 22px rgba(188, 119, 37, 0.22);
}

.mine-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.mine-primary:disabled { opacity: .42; cursor: not-allowed; transform: none; }

.mine-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #dccdb6;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.mine-message {
  min-height: 22px;
  margin: 8px 0 0;
  color: #dbc28d;
  font-size: 13px;
}

.mine-lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mine-option {
  border: 1px solid rgba(158, 182, 214, 0.14);
  border-radius: 16px;
  padding: 20px;
  background: rgba(148, 176, 215, 0.04);
}

.mine-option h2 { margin: 6px 0 5px; font-size: 19px; }
.mine-option p { color: #93a3ba; font-size: 13px; min-height: 42px; margin-bottom: 14px; }
.mine-option .mine-primary { width: 100%; margin-top: 10px; }
.mine-option-icon { color: #f1bc54; font-size: 24px; }
.mine-code-input { text-transform: uppercase; letter-spacing: .25em; text-align: center; font-weight: 900; }

.mine-rules {
  margin-top: 20px;
  color: #baa98e;
  font-size: 13px;
}

.mine-rules summary { cursor: pointer; color: #e5c275; font-weight: 700; }
.mine-rules div { display: grid; gap: 6px; margin-top: 10px; }

.mine-room-top { align-items: flex-start; }
.mine-room-code { letter-spacing: .14em; color: #ffd36e; }
.mine-room-list-head { margin: 22px 0 8px; }
.mine-room-list-head h2 { font-size: 18px; }
.mine-room-list-head span { color: #c9a963; }

.mine-room-players {
  list-style: none;
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.mine-room-players li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(224, 181, 102, 0.14);
  border-radius: 10px;
  padding: 10px 12px;
  color: #eadfcb;
}

.mine-badge {
  color: #2b1d0e;
  background: #d9a441;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

/* Game */
.mine-game-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: 14px;
  min-height: calc(100vh - 96px);
}

.mine-sidebar,
.mine-table-panel {
  background: #0b1220;
  border: 1px solid rgba(255, 184, 77, 0.16);
  border-radius: 18px;
  overflow: hidden;
}

.mine-sidebar { padding: 16px; }

.mine-role {
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
}

.mine-role.digger { background: linear-gradient(145deg, #345231, #1d3420); }
.mine-role.saboteur { background: linear-gradient(145deg, #632c26, #321818); }
.mine-role small { display: block; opacity: .7; text-transform: uppercase; letter-spacing: .12em; }
.mine-role strong { display: block; font-size: 21px; margin: 3px 0; }
.mine-role p { font-size: 11px; opacity: .78; line-height: 1.45; }

.mine-player-list { display: grid; gap: 7px; }

.mine-player-row {
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid transparent;
}

.mine-player-row.current {
  border-color: #e3ad49;
  background: rgba(227, 173, 73, .1);
}

.mine-player-name {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
}

.mine-player-meta {
  display: flex;
  justify-content: space-between;
  color: #9f927f;
  font-size: 10px;
  margin-top: 4px;
}

.mine-tools { letter-spacing: 2px; }
.mine-tools .broken { filter: grayscale(1); opacity: .25; text-decoration: line-through; }

.mine-log {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 10px;
  color: #988b79;
  font-size: 10px;
  display: grid;
  gap: 5px;
}

.mine-table-panel {
  display: grid;
  grid-template-rows: auto minmax(350px, 1fr) auto;
  min-width: 0;
}

.mine-statusbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, .18);
  border-bottom: 1px solid rgba(224, 181, 102, .13);
}

.mine-turn { font-weight: 900; color: #ffe0a0; }
.mine-status-meta { display: flex; gap: 14px; color: #a99a83; font-size: 12px; }

.mine-board-wrap {
  overflow: auto;
  padding: 24px;
  background:
    linear-gradient(rgba(6, 10, 20, .45), rgba(6, 10, 20, .45)),
    repeating-linear-gradient(90deg, #4a361f 0 3px, #5c4327 3px 80px, #3f2e1a 80px 83px);
  scrollbar-color: #5c4327 #14181f;
}

.mine-board {
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  align-content: center;
  justify-content: center;
}

.mine-cell {
  width: 68px;
  height: 92px;
  position: relative;
}

.mine-tile,
.mine-slot {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.mine-tile {
  position: relative;
  overflow: hidden;
  background: #d4bc8e;
  border: 2px solid #6f4d2c;
  box-shadow: 0 5px 10px rgba(0, 0, 0, .32);
}

.mine-tile svg { width: 100%; height: 100%; display: block; }
.mine-tile path { stroke: #392a1d; stroke-width: 18; stroke-linecap: round; fill: none; }
.mine-tile path.light { stroke: #8a704d; stroke-width: 9; }

.mine-tile.start {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #476843, #263e27);
  color: #ffdc84;
  font-size: 28px;
}

.mine-tile.goal {
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #6e2922, #351411);
  color: #ffd071;
  font-size: 28px;
  border-color: #2a0d0a;
}

.mine-tile.goal.known {
  outline: 3px solid #67b7d1;
  outline-offset: 2px;
}

.mine-slot {
  border: 2px dashed rgba(255, 235, 181, .55);
  background: rgba(255, 230, 169, .14);
  cursor: pointer;
  color: #fff4d1;
  font-size: 25px;
}

.mine-slot:hover { background: rgba(255, 220, 135, .3); }
.mine-tile.collapse-target { cursor: pointer; outline: 3px solid #e0644d; outline-offset: 2px; }

.mine-bottom {
  border-top: 1px solid rgba(224, 181, 102, .14);
  background: rgba(18, 14, 11, .48);
  padding: 12px 14px 14px;
}

.mine-action-hint {
  min-height: 22px;
  color: #ddc28e;
  font-size: 12px;
  margin-bottom: 8px;
}

.mine-action-choices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.mine-choice {
  border: 1px solid rgba(225, 177, 84, .3);
  background: rgba(225, 177, 84, .1);
  color: #f5dcaa;
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.mine-hand-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  overflow-x: auto;
  padding: 5px 2px 8px;
}

.mine-card {
  flex: 0 0 70px;
  height: 98px;
  border: 2px solid #694b2d;
  border-radius: 9px;
  background: linear-gradient(145deg, #ead7b0, #bda174);
  color: #2d2116;
  cursor: pointer;
  padding: 5px;
  position: relative;
  font: inherit;
  box-shadow: 0 4px 8px rgba(0, 0, 0, .28);
}

.mine-card.selected {
  transform: translateY(-8px);
  border-color: #ffd263;
  box-shadow: 0 0 0 3px rgba(255, 210, 99, .18), 0 8px 14px rgba(0, 0, 0, .35);
}

.mine-card svg { width: 100%; height: 100%; }
.mine-card path { stroke: #38291c; stroke-width: 19; stroke-linecap: round; }
.mine-card path.light { stroke: #8b7454; stroke-width: 9; }
.mine-card-action { display: grid; place-items: center; text-align: center; }
.mine-card-action .icon { font-size: 27px; line-height: 1; }
.mine-card-action strong { font-size: 10px; line-height: 1.1; }

.mine-hand-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

.mine-small-btn {
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .06);
  color: #ded0bb;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}

.mine-round-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 7, 5, .82);
  backdrop-filter: blur(6px);
}

.mine-result-card {
  width: min(620px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #0d1526;
  border: 1px solid rgba(255, 184, 77, .32);
  border-radius: 20px;
  padding: 25px;
  text-align: center;
}

.mine-result-card h2 { color: #ffd577; font-size: 30px; margin-bottom: 5px; }
.mine-result-grid { display: grid; gap: 7px; margin: 18px 0; text-align: left; }
.mine-result-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 9px 10px; border-radius: 9px; background: rgba(255,255,255,.04); }
.mine-role-label { color: #b5a58d; font-size: 12px; }
.mine-award { color: #ffd36e; font-weight: 900; }

.mine-toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #7a3028;
  color: white;
  border-radius: 10px;
  padding: 10px 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.4);
  font-size: 13px;
}

@media (max-width: 850px) {
  .mine-game-layout { grid-template-columns: 1fr; }
  .mine-sidebar { order: 2; }
  .mine-table-panel { min-height: 72vh; }
}

@media (max-width: 620px) {
  .mine-shell { padding: 12px; }
  .mine-panel { padding: 20px; }
  .mine-lobby-grid { grid-template-columns: 1fr; }
  .mine-title-lockup h1 { font-size: 30px; }
  .mine-logo { width: 55px; height: 55px; }
  .mine-board-wrap { padding: 14px; }
  .mine-cell { width: 58px; height: 80px; }
  .mine-card { flex-basis: 62px; height: 88px; }
}
