/* Modern Styles (Restored Layout) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

:root {
  color-scheme: dark;
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: 1px solid rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  --accent-color: #ff3548;
  --secondary-color: #36c877;
  --text-color: #ffffff;
}

/* Visibility Toggle for Tokens */
#game-board_div.hide-others .token:not(.is-me) {
  display: none !important;
}

/* Ensure tokens are never hidden in screenshot mode */
body.screenshot-mode #game-board_div .token,
body.screenshot-mode #game-board_div.hide-others .token {
  display: flex !important;
}

/* Custom Switch Toggle */
.switch-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: relative;
  width: 34px;
  height: 18px;
  background-color: #444;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: #36c877;
}

input:checked+.slider:before {
  transform: translateX(16px);
}

/* Active Token Highlight (Border + Shadow) */
.token.active-token {
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 5px rgba(0, 0, 0, 0.5) !important;
  z-index: 100 !important;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at center, #1a1a2e, #000000);
  width: 100%;
  color: var(--text-color);
  text-align: center;
}

/* Container */
.game-container {
  display: grid;
  /* Original layout: Left Sidebar | Board | Right Sidebar */
  grid-template-columns: 250px 1fr 250px;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  gap: 0px;
  padding: 20px;
  box-sizing: border-box;
}

/* Logo */
#logo {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  max-width: 200px;
  height: auto;
  margin-bottom: 20px;
  /* Removed absolute positioning to flow naturally in grid/flex */
}

/* Sidebars */
#left-sidebar {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  background: rgba(20, 20, 30, 0.6);
  /* Darker semi-transparent bg */
  backdrop-filter: blur(10px);
  border: var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  /* Readability fix */
  color: #ffffff !important;
  /* Force white text */
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

#resultText {
  font-size: 1.1em;
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.2);
  /* Semi-transparent background for text */
  padding: 10px;
  border-radius: 8px;
  width: 100%;
}

/* MAC Cards Deck */
#mac-card-deck {
  width: 120px;
  height: 160px;
  background: linear-gradient(135deg, #6e45e2, #88d3ce);
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid rgba(255, 255, 255, 0.3);
  margin-top: 10px;
}

#mac-card-deck:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(255, 255, 255, 0.4);
}

#mac-card-deck:active {
  transform: scale(0.95);
}

.deck-text {
  color: white;
  font-weight: bold;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  font-size: 1.1em;
  pointer-events: none;
  /* Let clicks pass to container */
}

#right-sidebar {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  background: rgba(20, 20, 30, 0.6);
  /* Darker semi-transparent bg */
  backdrop-filter: blur(10px);
  border: var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  justify-content: flex-start;
  padding-top: 20px;
  color: #ffffff !important;
  /* Force white text */
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

#active-player-info {
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 8px;
  width: 100%;
  text-align: center;
  margin-bottom: 20px;
}

#active-player-token {
  width: 50px;
  height: 50px;
  margin: 10px auto;
  position: relative;
  /* Override absolute positioning from .token class for this specific element */
  top: auto;
  left: auto;
  transform: none;
}

#lk-btn-link {
  margin-top: 0 !important;
  margin-bottom: 5px !important;
}

#onboarding-tour-btn {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}

#players-list-container {
  width: 100%;
  text-align: left;
}

#all-players-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 460px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

#all-players-list::-webkit-scrollbar {
  width: 5px;
}

#all-players-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

#all-players-list li {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-radius: 8px;
  transition: background 0.15s ease;
  position: relative;
  box-sizing: border-box;
  width: 100%;
}

#all-players-list li:hover {
  background: rgba(255, 255, 255, 0.03);
}

#all-players-list li:last-child {
  border-bottom: none;
}

#all-players-list li.active {
  background: rgba(139, 92, 246, 0.14) !important;
  border: 1px solid rgba(139, 92, 246, 0.35) !important;
  border-radius: 8px;
}

/* Header row (Row 1): Avatar + Name + Diary */
.player-item-header {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.player-item-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

/* Token Wrapper with status dot */
.player-token-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Dedicated avatar token for players list, avoiding all conflicts with .token */
.player-list-token {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  font-weight: bold !important;
  font-size: 0.68em !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
  z-index: 1 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}
.player-list-token.circle { border-radius: 50% !important; }
.player-list-token.square { border-radius: 4px !important; }
.player-list-token.rounded { border-radius: 8px !important; }
.player-list-token.triangle { clip-path: polygon(50% 0%, 0% 100%, 100% 100%) !important; border-radius: 0 !important; }
.player-list-token.diamond { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%) !important; border-radius: 0 !important; }
.player-list-token.pentagon { clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%) !important; border-radius: 0 !important; }
.player-list-token.hexagon { clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%) !important; border-radius: 0 !important; }

/* Status dot on avatar */
.player-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid #161b2e;
  z-index: 2;
  box-sizing: border-box;
}
.player-status-dot.dot-active { background: #22c55e; box-shadow: 0 0 4px #22c55e; }
.player-status-dot.dot-paused { background: #f59e0b; box-shadow: 0 0 4px #f59e0b; }
.player-status-dot.dot-frozen { background: #38bdf8; box-shadow: 0 0 4px #38bdf8; }
.player-status-dot.dot-finished { background: #94a3b8; }

/* Player Name - FULL READABLE WIDTH */
.player-item-name {
  font-size: 0.9em;
  font-weight: 600;
  color: #f8fafc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}

/* Diary Icon */
.player-item-diary {
  flex-shrink: 0;
  font-size: 0.85em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}

/* Row 2: Footer */
.player-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-left: 32px;
  box-sizing: border-box;
  gap: 6px;
}

.player-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.player-item-position {
  font-size: 0.74em;
  color: #94a3b8;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Status badge in row 2 */
.player-item-status {
  font-size: 0.68em;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-item-status.status-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.player-item-status.status-paused {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.player-item-status.status-frozen {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.player-item-status.status-finished {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Host action buttons */
.player-admin-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.player-admin-controls button {
  padding: 0 !important;
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.75em !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 4px !important;
  color: #fff !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.player-admin-controls button:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-1px);
}

.player-admin-controls button.btn-del {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.28) !important;
}

.player-admin-controls button.btn-del:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

/* Central Board Area */
#game-board_div {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  /* Align top */
  overflow: auto;
  /* padding: 20px; */
  margin-top: -40px;
}

#game-board {
  border-collapse: separate;
  border-spacing: 5px;
  background-image: url('/img/pole.jpg');
  background-size: 100% 100%;
  /* Fix misalignment: stretch image exactly to table bounds */
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  padding: 33px 34px;
}

#game-board td {
  /* Restored original large size */
  /* width: 120px; */
  /* height: 120px; */
  width: 105px;
  height: 105px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  color: transparent;
  /* Text hidden */
  cursor: pointer;
}

/* History - Bottom Full Width */
#players-list {
  grid-column: 1 / 4;
  grid-row: 3 / 4;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: var(--glass-border);
  border-radius: 16px;
  padding: 20px 20px 60px 20px;
  /* More bottom padding */
  margin-top: 20px;
  min-height: 200px;
  /* "2nd screen" feel */
}

ul#player-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  list-style: none;
  padding: 0;
}

#player-info li {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 12px;
  min-width: 300px;
  max-height: 400px;
  /* Prevent it from growing too long */
  overflow-y: auto;
  /* Add scroll if history is long */
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.1em;
  line-height: 1.5;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

#player-info li strong {
  font-size: 1.3em;
  display: block;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Buttons */
button {
  width: 100%;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

button:hover {
  transform: translateY(-2px);
}

#roll-dice-btn {
  background: linear-gradient(135deg, #ff3548, #ff7a85);
  color: white;
}

#enterGameBtn {
  background: linear-gradient(135deg, #36c877, #6cfcb0);
  color: white;
}

#add-player-btn {
  background: linear-gradient(135deg, #ffc98d, #ffdea8);
  color: #333;
}

#reset-game-btn {
  background: linear-gradient(135deg, #ff4b1f, #ff9068);
  color: white;
}

/* Dice Container */
#threejs-canvas {
  width: 200px;
  height: 140px;
  /* Cropped excessive transparent vertical space */
  margin-bottom: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#threejs-canvas canvas {
  width: 200px !important;
  height: 200px !important;
  max-width: none;
  max-height: none;
}

/* Tokens */
.token {
  width: 35px;
  height: 35px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;

  /* Text Centering */
  display: flex !important;
  /* Force flex */
  justify-content: center;
  align-items: center;
  color: white;
  font-weight: bold;
  font-size: 0.8em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  user-select: none;
  z-index: 10;
}

/* Shapes */
.token.circle {
  border-radius: 50%;
}

.token.square {
  border-radius: 4px;
}

.token.rounded {
  border-radius: 12px;
}

/* Clip-path shapes (keep background-color working) */
.token.triangle {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-radius: 0;
}

.token.diamond {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  border-radius: 0;
}

.token.pentagon {
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  border-radius: 0;
}

.token.hexagon {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  border-radius: 0;
}

/* Modal */
/* Modal Overlay */
#modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  /* Dark overlay */
  z-index: 10010;
  display: flex;
  /* Flex to center content */
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#modal.visible {
  opacity: 1;
  pointer-events: auto;
}

#modal.hidden {
  display: none;
}

/* Modal Content Box */
.modal-content {
  background: rgba(20, 20, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 30px;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  cursor: default;
  overflow-y: auto;
  /* Prevent pointer events falling through */
}

#modal.visible .modal-content,
#my-mac-cards-modal .modal-content,
#image-viewer-modal .modal-content {
  transform: scale(1);
}

#modal img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  margin-bottom: 20px;
}

#modal-text {
  font-size: 1.2em;
}

#close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 32px;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #ff4d4d;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
  -webkit-filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
  transition: all 0.3s ease;
  z-index: 2001;
}

#close-modal:hover {
  color: #ff3333;
  transform: scale(1.1);
  filter: drop-shadow(0 4px 12px rgba(255, 77, 77, 0.7));
  -webkit-filter: drop-shadow(0 4px 12px rgba(255, 77, 77, 0.7));
}

.modal-content.text-only-modal {
  max-width: 600px;
  padding: 25px 30px;
  box-sizing: border-box;
  text-align: left;
}

/* Helpers */
.hidden {
  display: none !important;
}

/* Simple history table */
.history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.9em;
}

.history-table td {
  padding: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* =========================================
   Medium Screens Adaptation (Laptops 1200px - 1440px)
   ========================================= */
@media (max-width: 1440px) and (min-width: 1201px) {
  #game-board {
    border-spacing: 0px;
    padding: 26px 26px 31px;
  }

  #game-board td {
    width: 75px;
    height: 75px;
  }
}

/* =========================================
   Tablet Screens Adaptation (981px - 1200px)
   ========================================= */
@media (max-width: 1200px) and (min-width: 981px) {
  #game-board {
    border-spacing: 0px;
    padding: 26px 34px 31px;
  }

  #game-board td {
    width: 95px;
    height: 95px;
  }
}

/* =========================================
   Mobile Adaptation (Responsive Design)
   ========================================= */

@media (max-width: 1200px) {
  .game-container {
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 15px;
    height: auto;
    min-height: auto;
  }

  /* Reorder for mobile flow */
  #left-sidebar {
    order: 1;
    /* Dice & Controls first */
    width: 100%;
    margin: 0;
    box-shadow: none;
    box-sizing: border-box;
  }

  #game-board_div {
    order: 2;
    /* Board second */
    width: 100%;
    max-width: 100vw;
    /* Prevent viewport overflow */
    margin-top: 0;
    display: block;
    /* Standard block */
    overflow-x: auto;
    /* Horizontal Scroll */
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
    padding: 10px 0;

    /* Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
  }

  #game-board_div::-webkit-scrollbar {
    height: 8px;
  }

  #game-board_div::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
  }

  #game-board {
    margin: 0 auto;
    /* Force minimum width to trigger scroll on small screens */
    /* 9 columns * 105px + spacing ~ 1000px */
    min-width: 960px;
    width: 960px;
    /* Prevent table compression */
    table-layout: fixed;
  }

  /* Optional: scale down slightly? */
  /* transform-origin: top center; */


  #right-sidebar {
    order: 3;
    /* Player Info third */
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  #lk-btn-link {
    order: 99 !important;
    margin-top: 15px !important;
    margin-bottom: 0 !important;
  }

  #onboarding-tour-btn {
    order: 100 !important;
    margin-top: 10px !important;
    margin-bottom: 0 !important;
  }

  #open-feedback-form {
    order: 101 !important;
    margin-top: 10px !important;
    margin-bottom: 0 !important;
    font-size: 0.9em !important;
  }

  #players-list {
    order: 4;
    /* History last */
    width: 100%;
    margin-top: 20px;
    box-sizing: border-box;
    /* Prevent padding overflow */
  }

  /* Adjustments */
  #logo {
    max-width: 150px;
  }

  /* Settings previously here for #threejs-canvas were removed to keep it 200x200 */

  #modal-text {
    font-size: 1em;
  }

  /* Touch target improvements */
  button {
    padding: 15px;
    font-size: 1.1em;
  }
}

@media (max-width: 768px) {

  /* Hardcore mobile adjustments */
  #game-board {
    margin: 0 auto;
    /* Reduced size for phones: 9*80 = 720 + padding = 776px */
    border-spacing: 0px;
    padding: 26px 28px 31px;
    min-width: 776px;
    width: 776px;
    table-layout: fixed;
  }

  #game-board td {
    width: 80px;
    height: 80px;
  }

  .token {
    width: 30px;
    height: 30px;
  }

  #player-info li {
    min-width: 0;
  }

  /* Remove the 300px limit */
  .token {
    width: 30px;
    height: 30px;
  }
}

/* =========================================
   Export Button Styles (Global)
   ========================================= */
.player-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.mini-export-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  cursor: pointer;
  font-size: 1.2em;
  padding: 2px 8px;
  border-radius: 4px;
  transition: background 0.2s;
  max-width: 70px;
}

.mini-export-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Auth Overlay */
#auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1a1a2e, #000000);
  z-index: 5000;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

#auth-box {
  background: rgba(20, 20, 30, 0.95);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
  text-align: center;
  width: 380px;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#auth-box h2 {
  margin-bottom: 10px;
  font-size: 2.2em;
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 20%, #ddd6fe 65%, #a29bfe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 14px rgba(110, 69, 226, 0.4);
  forced-color-adjust: none;
}

#auth-box p {
  color: #ccc;
  margin-bottom: 25px;
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.auth-btn {
  display: block;
  padding: 14px;
  text-decoration: none;
  font-weight: bold;
  border-radius: 12px;
  transition: all 0.3s ease;
  color: white;
  text-align: center;
  font-size: 1.05em;
}

.vk-btn {
  background: #4C75A3;
}

.tg-btn {
  background: #0088cc;
}

.yandex-btn {
  background: white;
  color: black !important;
  border: 1px solid #e0e0e0;
}

.auth-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.1);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #666;
  margin: 20px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider:not(:empty)::before {
  margin-right: .5em;
}

.divider:not(:empty)::after {
  margin-left: .5em;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#login-input,
#password-input,
.auth-input {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1em;
  box-sizing: border-box;
  transition: all 0.3s;
  margin-bottom: 10px;
}

#login-input:focus,
#password-input:focus,
.auth-input:focus {
  border-color: #4da6ff;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

#email-login-btn {
  background: linear-gradient(135deg, #6e45e2, #88d3ce);
  color: white;
  margin-top: 5px;
}

/* Password Toggle Styles */
.password-container {
  position: relative;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  cursor: pointer;
  font-size: 1.2em;
  opacity: 0.6;
  z-index: 10;
  box-shadow: none !important;
}

.password-toggle:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

/* Modal text overlap fix */
#modal-text {
  font-size: 1.2em;
  padding-top: 20px;
  /* Space for the close button */
  padding-right: 10px;
  padding-left: 10px;
  word-wrap: break-word;
  max-width: 100%;
}

/* Feedback Modal Styling */
@keyframes feedbackFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#feedback-modal .feedback-content {
  animation: feedbackFadeIn 0.4s ease-out;
}

#feedback-modal input:focus,
#feedback-modal select:focus {
  border-color: #4CAF50 !important;
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

#fb-submit:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(46, 125, 50, 0.4);
}

#fb-submit:active {
  transform: scale(0.98);
}

#open-feedback-form {
  color: #4CAF50 !important;
  text-decoration: underline;
  font-weight: bold;
  cursor: pointer;
}

#open-feedback-form:hover {
  color: #6cfcb0 !important;
}

/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #ccc;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 9999;
  box-sizing: border-box;
  animation: slideUp 0.5s ease-out;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cookie-content {
  font-size: 0.95em;
  line-height: 1.5;
  max-width: 80%;
  text-align: left;
}

.cookie-content a {
  color: #4da6ff;
  text-decoration: none;
}

.cookie-content a:hover {
  text-decoration: underline;
}

.cookie-btn {
  background: linear-gradient(135deg, #36c877, #6cfcb0);
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  white-space: nowrap;
  margin-left: 20px;
  width: auto;
}

.cookie-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 5px 15px rgba(54, 200, 119, 0.3);
}

@media (max-width: 768px) {
  .cookie-banner {
    flex-direction: column;
    padding: 20px;
    text-align: center;
  }
  .cookie-content {
    max-width: 100%;
    margin-bottom: 15px;
    text-align: center;
  }
  .cookie-btn {
    margin-left: 0;
    width: 100%;
  }
}

/* --- Адаптивное мобильное меню (Мобильный Drawer) --- */

/* Стили по умолчанию (для десктопов скрыто) */
.mobile-header,
.sidebar-overlay {
  display: none;
}

@media (max-width: 1024px) {
  /* Фиксированная верхняя панель */
  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(20, 20, 30, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 9999;
    box-sizing: border-box;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  }

  .mobile-logo {
    font-size: 1.05rem;
    font-weight: bold;
    color: #ffffff;
    background: linear-gradient(135deg, #ffffff 20%, #ddd6fe 65%, #a29bfe 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(110, 69, 226, 0.35);
    forced-color-adjust: none;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 120px);
  }

  /* Бургер-кнопка (Заметная, стильная, контрастная) */
  .mobile-menu-toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    width: 42px !important;
    height: 42px !important;
    background: linear-gradient(135deg, rgba(110, 69, 226, 0.32) 0%, rgba(74, 0, 224, 0.28) 100%) !important;
    border: 1px solid rgba(162, 155, 254, 0.45) !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 12px rgba(110, 69, 226, 0.35) !important;
    z-index: 10001 !important;
    flex-shrink: 0 !important;
    transition: all 0.25s ease !important;
    forced-color-adjust: none !important;
    color-scheme: dark !important;
  }

  .mobile-menu-toggle:hover {
    background: linear-gradient(135deg, rgba(110, 69, 226, 0.5) 0%, rgba(74, 0, 224, 0.4) 100%) !important;
    border-color: rgba(162, 155, 254, 0.7) !important;
    box-shadow: 0 4px 16px rgba(110, 69, 226, 0.55) !important;
    transform: scale(1.04);
  }

  .mobile-menu-toggle:active {
    transform: scale(0.96);
  }

  .mobile-menu-toggle span {
    display: block !important;
    width: 22px !important;
    height: 2.5px !important;
    background-color: #ffffff !important;
    border-radius: 2px !important;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.9) !important;
    forced-color-adjust: none !important;
    color-scheme: dark !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, background-color 0.25s ease !important;
  }

  /* Анимация бургера в крестик */
  .mobile-menu-toggle.open {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.32) 0%, rgba(185, 28, 28, 0.28) 100%) !important;
    border-color: rgba(248, 113, 113, 0.55) !important;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.4) !important;
  }

  .mobile-menu-toggle.open span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg) !important;
  }

  .mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0 !important;
  }

  .mobile-menu-toggle.open span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg) !important;
  }

  /* Затемнение фона с размытием (Glassmorphism overlay) */
  .sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
  }

  .sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Позиционирование контейнера с учетом фиксированной шапки */
  .cabinet-container {
    padding-top: 80px !important;
  }

  /* Адаптивный сайдбар в виде выдвижной панели */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 300px !important;
    max-width: 80% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    z-index: 10000 !important;
    background: rgba(20, 20, 30, 0.85) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0 !important;
    padding: 24px 20px calc(65px + env(safe-area-inset-bottom, 20px)) 20px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    transform: translateX(-100%) !important;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .sidebar > * {
    flex-shrink: 0 !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 15px 0 40px rgba(0, 0, 0, 0.6) !important;
  }

  /* Сброс горизонтальной раскладки табов в сайдбаре */
  .sidebar .tabs {
    flex-direction: column !important;
    overflow-x: visible !important;
    white-space: normal !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .sidebar .tab-btn {
    width: 100% !important;
    flex-shrink: 0 !important;
    white-space: normal !important;
  }

}

/* Блокировка скролла страницы при открытом меню */
body.menu-open {
  overflow: hidden !important;
}

/* ========================================== */
/* Board Scroll Hint Animation & Styling      */
/* ========================================== */
#game-board_div {
  position: relative; /* Context for absolute positioning of the scroll hint */
}

@keyframes swipeHand {
  0%, 100% { transform: translateX(8px); }
  50% { transform: translateX(-8px); }
}

.board-scroll-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 150px;
  z-index: 100;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  opacity: 1;
  visibility: visible;
}

.scroll-hint-content {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(20, 24, 46, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 8px 16px;
  border-radius: 20px;
  color: #38bdf8;
  font-weight: bold;
  font-size: 0.85em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 10px rgba(56, 189, 248, 0.15);
  white-space: nowrap;
}

.scroll-hint-icon {
  display: inline-block;
  animation: swipeHand 1.6s infinite ease-in-out;
  font-size: 1.2em;
}

.board-scroll-hint.fade-out {
  opacity: 0;
  visibility: hidden;
}

/* ========================================== */
/* Mobile Compact UI Styles (max-width: 768px)*/
/* ========================================== */
@media (max-width: 768px) {
  /* Sidebar compact layout */
  #left-sidebar {
    padding: 12px !important;
    gap: 8px !important;
  }

  #left-sidebar a[href="https://psi-u.ru/"] {
    margin-bottom: 5px !important;
  }

  #logo {
    max-width: 130px !important;
  }

  #resultText {
    font-size: 0.95em !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    text-align: center !important;
  }



  #manual-dice-container {
    margin: 4px 0 !important;
  }

  #manual-dice-container span {
    font-size: 0.8em !important;
    margin-bottom: 2px !important;
  }

  #debug-dice-input {
    padding: 6px !important;
    font-size: 0.95em !important;
    width: 50px !important;
  }

  #roll-dice-btn {
    padding: 10px 20px !important;
    font-size: 1.05em !important;
    margin-bottom: 5px !important;
    width: 100% !important;
    max-width: 280px !important;
  }

  /* MAC Cards Deck as horizontal button */
  #mac-card-deck {
    width: 100% !important;
    max-width: 280px !important;
    height: 42px !important;
    padding: 8px 12px !important;
    margin-top: 5px !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #6e45e2, #88d3ce) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4) !important;
    transform: none !important;
  }

  #mac-card-deck:hover {
    transform: translateY(-2px) !important;
  }

  #mac-card-deck br {
    display: none !important;
  }

  .deck-text {
    font-size: 0.9em !important;
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .modal-content {
    padding: 15px !important;
    max-width: 95vw !important;
    max-height: 95vh !important;
    border-radius: 12px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .modal-content.text-only-modal {
    padding: 20px !important;
    max-width: 90vw !important;
  }

  #close-modal {
    top: 8px !important;
    right: 8px !important;
    font-size: 28px !important;
    width: 28px !important;
    height: 28px !important;
  }

  #modal img {
    max-height: 75vh !important;
    margin-bottom: 12px !important;
    border-radius: 6px !important;
  }

  #modal-text {
    font-size: 0.95em !important;
    text-align: center !important;
  }
}

/* Access Control Overlays Styles (Stage 3) */
#access-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* Controlled dynamically */
  align-items: center;
  justify-content: center;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#access-overlay.visible {
  display: flex !important;
}

#access-overlay .modal-content {
  background: rgba(15, 15, 20, 0.85) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
  padding: 30px !important;
  color: #fff;
  width: 90%;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Save Dialog Cards Styling (Glassmorphism) */
.save-action-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.save-action-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.save-action-card input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  margin: 0;
  font: inherit;
  color: rgba(255, 255, 255, 0.3);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

.save-action-card input[type="radio"]::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: scale(0);
  transition: 0.2s transform ease-in-out;
  background-color: #2196f3;
}

.save-action-card input[type="radio"]:checked {
  border-color: #2196f3;
}

.save-action-card input[type="radio"]:checked::before {
  transform: scale(1);
}

/* Color accents based on radio value */
.save-action-card:has(input[value="save"]:checked) {
  background: rgba(33, 150, 243, 0.08) !important;
  border-color: rgba(33, 150, 243, 0.4) !important;
  box-shadow: 0 0 15px rgba(33, 150, 243, 0.15);
}
.save-action-card:has(input[value="save"]:checked) input[type="radio"]::before {
  background-color: #2196f3;
}
.save-action-card:has(input[value="save"]:checked) input[type="radio"] {
  border-color: #2196f3;
}

.save-action-card:has(input[value="pause"]:checked) {
  background: rgba(255, 152, 0, 0.08) !important;
  border-color: rgba(255, 152, 0, 0.4) !important;
  box-shadow: 0 0 15px rgba(255, 152, 0, 0.15);
}
.save-action-card:has(input[value="pause"]:checked) input[type="radio"]::before {
  background-color: #ff9800;
}
.save-action-card:has(input[value="pause"]:checked) input[type="radio"] {
  border-color: #ff9800;
}

.save-action-card:has(input[value="completed"]:checked) {
  background: rgba(76, 175, 80, 0.08) !important;
  border-color: rgba(76, 175, 80, 0.4) !important;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.15);
}
.save-action-card:has(input[value="completed"]:checked) input[type="radio"]::before {
  background-color: #4caf50;
}
.save-action-card:has(input[value="completed"]:checked) input[type="radio"] {
  border-color: #4caf50;
}

.save-action-card .card-icon {
  font-size: 1.5em;
  line-height: 1;
  flex-shrink: 0;
}

.save-action-card .card-content {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.save-action-card .card-title {
  color: #fff;
  font-size: 0.95em;
  font-weight: bold;
}

.save-action-card .card-desc {
  font-size: 0.85em;
  color: #aaa;
  margin-top: 4px;
  line-height: 1.35;
}

/* Metaphoric associative cards (MAC) modal layout adjustments */
.mac-modal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}
.mac-modal-container #modal-image {
  margin-bottom: 0 !important;
}
#mac-questions {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px;
  border-radius: 12px;
  text-align: left;
  line-height: 1.5;
  color: #e2e8f0;
  width: 100%;
  box-sizing: border-box;
  backdrop-filter: blur(10px);
  box-shadow: inset 0 20px 80px rgba(255, 255, 255, 0.02);
}
#mac-questions h4 {
  margin-top: 0;
  color: #38bdf8;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 8px;
  margin-bottom: 12px;
  font-size: 1.1em;
}
#mac-questions ul {
  padding-left: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.95em;
}

@media (min-width: 769px) {
  .mac-modal-container.with-questions {
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    max-width: 850px;
  }
  .mac-modal-container.with-questions #modal-image {
    max-width: 50%;
    object-fit: contain;
  }
  .mac-modal-container.with-questions #mac-questions {
    max-width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* FAQ & Sidebar Styles */
.faq-content { text-align: left !important; }
.faq-content h2, .faq-content h3, .faq-content h4, .faq-content p, .faq-content div { text-align: left; }
.faq-tabs-nav { flex-shrink: 0 !important; }
.faq-tab-btn { flex: 1 1 0 !important; text-align: center !important; }
.faq-tabs-content { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; text-align: left !important; }
.faq-tabs-content::-webkit-scrollbar { width: 6px; }
.faq-tabs-content::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.35); border-radius: 4px; }
.faq-accordion-item { text-align: left !important; }
.faq-accordion-item * { box-sizing: border-box; }

/* Right Sidebar & Buttons Layout */
#right-sidebar {
  width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 40px) !important;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  padding: 16px 14px !important;
  gap: 12px !important;
}

#right-sidebar::-webkit-scrollbar {
  width: 4px;
}

#right-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-actions-group,
.sidebar-tools-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.sidebar-action-btn[style*="display: none"] {
  display: none !important;
}

.sidebar-action-btn {
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: 38px !important;
  height: 38px !important;
  padding: 0 12px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 9px !important;
  border-radius: 8px !important;
  font-size: 0.88em !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f1f5f9 !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.sidebar-action-btn .btn-icon {
  font-size: 1.1em !important;
  line-height: 1 !important;
  flex-shrink: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.sidebar-action-btn .btn-text {
  flex: 1 1 auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  text-align: left !important;
}

.sidebar-action-btn:hover {
  transform: translateY(-1px) !important;
  filter: brightness(1.15) !important;
}

/* Individual button color themes */
.sidebar-action-btn.btn-lk {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #f8fafc !important;
}

.sidebar-action-btn.btn-faq {
  background: rgba(168, 85, 247, 0.12) !important;
  border-color: rgba(168, 85, 247, 0.35) !important;
  color: #c084fc !important;
}

.sidebar-action-btn.btn-tour {
  background: rgba(56, 189, 248, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.32) !important;
  color: #38bdf8 !important;
}

.sidebar-action-btn.btn-feedback {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.32) !important;
  color: #34d399 !important;
}

.sidebar-action-btn.btn-mac {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
  color: #ffffff !important;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.25) !important;
}

.sidebar-action-btn.btn-diary {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(99, 102, 241, 0.3) 100%) !important;
  border: 1px solid rgba(139, 92, 246, 0.45) !important;
  color: #ddd6fe !important;
}

.sidebar-action-btn.btn-pwa {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(56, 189, 248, 0.16) 100%) !important;
  border: 1px solid rgba(139, 92, 246, 0.38) !important;
  color: #e0e7ff !important;
}

#my-player-card {
  text-align: left !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#my-rename-btn {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Game Paused Glass Card (Liladay) */
.game-paused-glass-card {
  background: rgba(18, 22, 38, 0.85) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  backdrop-filter: blur(14px) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  padding: 16px 14px !important;
  text-align: center !important;
  margin: 12px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.paused-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 12px !important;
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-radius: 20px !important;
  font-size: 0.84em !important;
  font-weight: 700 !important;
  color: #fbbf24 !important;
  margin-bottom: 12px !important;
}

.paused-badge-icon {
  font-size: 0.9em;
  line-height: 1;
}

.paused-cell-box {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
  margin-bottom: 10px !important;
}

.paused-cell-label {
  display: block;
  font-size: 0.76em;
  color: #94a3b8;
  margin-bottom: 3px;
}

.paused-cell-val {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cell-num-badge {
  background: rgba(56, 189, 248, 0.15) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  font-size: 1.05em !important;
}

.cell-name-text {
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.95em;
}

.paused-desc {
  font-size: 0.82em !important;
  color: #cbd5e1 !important;
  line-height: 1.45 !important;
  margin: 0 0 12px 0 !important;
}

.paused-renew-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 10px 14px !important;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 700 !important;
  font-size: 0.9em !important;
  border-radius: 9px !important;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35) !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
}

.paused-renew-btn:hover {
  transform: translateY(-1px) !important;
  filter: brightness(1.1) !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45) !important;
}

/* Responsive FAQ Modal Tabs for Mobile */
.faq-tab-text-short {
  display: none;
}
.faq-tab-text-full {
  display: inline;
}

@media (max-width: 600px) {
  .faq-tab-text-full {
    display: none !important;
  }
  .faq-tab-text-short {
    display: inline !important;
  }
  .faq-tabs-nav {
    padding: 8px 8px !important;
    gap: 4px !important;
    overflow-x: hidden !important;
  }
  .faq-tab-btn {
    padding: 8px 4px !important;
    font-size: 0.8em !important;
    min-height: 36px !important;
  }
}
