:root {
  --bg-overlay: rgba(0, 0, 0, 0.45);
  --panel: rgba(255, 255, 255, 0.1);
  --panel-strong: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.3);
  --white: #fff;
  --accent: #2ecc71;
  --accent-2: #1f9d57;
  --sell-color: #e53935;
  --bitcoin-color: #f7931a;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--white);
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: url("images/bg.webp") center/cover fixed no-repeat;
  overscroll-behavior: none;
}

.login-bg {
  display: grid;
  place-items: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 12px 18px;
  background: var(--bg-overlay);
  border-bottom: 1px solid var(--border);
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr 360px;
  gap: 24px;
  height: calc(100vh - 120px);
  padding: 24px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.2));
}

.click-area {
  display: grid;
  place-items: center;
  position: relative;
  height: 100%;
  min-height: 520px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.site-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 24px;
  text-align: center;
}

.site-footer a {
  color: var(--white);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.site-footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

.login-container {
  width: 360px;
  padding: 22px;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(4px);
}

.login-container h1 {
  margin: 0 0 14px;
  font-weight: 700;
  text-align: center;
}

.form-group {
  margin-bottom: 12px;
  text-align: center;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}

.form-note {
  margin: 6px 0 0 0;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  opacity: 0.8;
}

.password-input-container {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.password-input-container input {
  width: 100%;
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  padding: 4px;
  color: var(--white);
  background: none;
  border: none;
  border-radius: 4px;
  opacity: 0.7;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity 0.2s ease;
}

.password-toggle:hover {
  opacity: 1;
}

.password-toggle:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.eye-icon,
.eye-off-icon {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.eye-off-icon {
  display: none;
}

.password-input-container.showing .eye-icon {
  display: none;
}

.password-input-container.showing .eye-off-icon {
  display: block;
}

.avatar-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.avatar-option {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}

.avatar-option img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: 50%;
  object-fit: cover;
}

.avatar-option input {
  display: none;
}

.avatar-option:has(input:checked) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn {
  width: 100%;
  padding: 10px 14px;
  color: #0b0b0b;
  font-weight: 700;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  appearance: none;
  transition: transform 0.06s ease, background 0.2s ease;
}

.btn:hover {
  background: #3be27f;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn-outline {
  color: var(--white);
  background: transparent;
  border: 1px solid var(--border);
}

.btn-disabled {
  color: #e9e9e9 !important;
  background: #6b6b6b !important;
  cursor: not-allowed !important;
}

.transaction-mode-selector {
  display: flex;
  gap: 8px;
  margin: 0 10px 10px;
}

.btn-mode {
  flex-grow: 1;
  padding: 8px 12px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--white);
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-mode.active {
  color: #0b0b0b;
  background-color: var(--accent);
}

.btn-mode[data-mode="sell"].active {
  background-color: var(--sell-color);
  color: var(--white);
}

.btn-vender {
  background: var(--sell-color) !important;
  color: var(--white) !important;
}

.btn-vender:hover {
  background: #c62828 !important;
}

.buy-multiplier-selector {
  display: flex;
  gap: 8px;
  margin: 0 10px 14px;
  padding: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.btn-multiplier {
  flex-grow: 1;
  padding: 6px 10px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--white);
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  opacity: 0.7;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-multiplier:hover {
  background-color: var(--panel);
  opacity: 1;
}

.btn-multiplier.active {
  color: #0b0b0b;
  background-color: var(--accent);
  border-color: rgba(255, 255, 255, 0.5);
  opacity: 1;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  object-fit: cover;
  image-rendering: pixelated;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  font-weight: 700;
}

.link {
  padding: 0;
  color: var(--white);
  text-align: left;
  text-decoration: underline;
  background: transparent;
  border: none;
  opacity: 0.85;
  cursor: pointer;
  appearance: none;
}

.hud {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.money {
  font-size: 22px;
  font-weight: 700;
}

.mps {
  opacity: 0.9;
}

.panel {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  padding: 16px;
  overflow-y: auto;
  background: var(--bg-overlay);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(4px);
}

.panel-title {
  margin: 0 0 8px;
  font-weight: 700;
  text-align: center;
}

.panel-content {
  flex-grow: 1;
  overflow-y: auto;
}

.panel-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.panel-item:hover {
  background: var(--panel-strong);
}

.panel-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
  image-rendering: pixelated;
}

.panel-body {
  display: grid;
  gap: 8px;
}

.panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-name {
  font-weight: 700;
}

.panel-owned {
  opacity: 0.85;
}

.panel-stats {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.stat {
  font-size: 14px;
  opacity: 0.95;
}

.price {
  font-weight: 700;
}

#left-panel {
  display: flex;
  flex-direction: column;
}

.placar-container {
  margin-bottom: 16px;
  padding: 0 10px 16px;
  border-bottom: 1px solid var(--border);
}

.placar-lista {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.placar-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
}

.placar-item .posicao {
  margin-right: 10px;
  font-weight: 700;
}

.placar-item .nome {
  overflow: hidden;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.placar-item .dinheiro {
  margin-left: 10px;
  color: var(--accent);
  font-weight: 700;
}

.note {
  width: 20vw;
  max-width: 100vw;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -moz-user-select: none;
  -ms-user-select: none;
  image-rendering: pixelated;
  transition: transform 0.08s ease;
}

.note.hit {
  transform: scale(0.90) rotate(-0.9deg);
}

.pop {
  position: absolute;
  font-weight: 700;
  user-select: none;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  animation: pop 0.8s ease forwards;
}

@keyframes pop {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60px) scale(1.1);
  }
}

.fade-in {
  animation: fade 0.25s ease both;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg {
  display: none;
  min-height: 20px;
  margin-top: 8px;
}

.msg.show {
  display: block;
}

.tax-notification {
  display: flex;
  align-items: center;
  gap: 15px;
  position: fixed;
  top: 80px;
  left: 50%;
  padding: 12px 20px;
  color: white;
  font-family: 'Poppins', sans-serif;
  background-color: rgba(185, 28, 28, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  z-index: 1000;
  animation: slideDownFadeIn 0.5s ease forwards;
}

.tax-notification img {
  width: 40px;
  height: 40px;
}

.tax-notification p {
  margin: 0;
  font-weight: 500;
}

@keyframes slideDownFadeIn {
  from {
    top: 40px;
    opacity: 0;
  }
  to {
    top: 80px;
    opacity: 1;
  }
}

.update-popup-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  padding: 16px;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.update-popup {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  padding: 24px;
  background: #1e1e1e;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease forwards;
}

.update-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.update-popup-header h2 {
  margin: 0;
  font-size: 30px;
}

.update-popup-close-btn {
  font-size: 32px;
  line-height: 1;
  color: var(--white);
  background: none;
  border: none;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.update-popup-close-btn:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.update-popup-body {
  overflow-y: auto;
  line-height: 1.6;
}

.update-popup-body p {
  margin: 0 0 12px;
  opacity: 0.9;
}

.update-popup-footer {
  margin-top: 20px;
  text-align: right;
  flex-shrink: 0;
}

.update-popup-footer label {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  opacity: 0.8;
  cursor: pointer;
}

.update-popup-footer input[type="checkbox"] {
  margin-right: 8px;
  accent-color: var(--accent);
}

.save-notification {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background-color: var(--accent);
  color: #0b0b0b;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.save-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.panel-content::-webkit-scrollbar {
  width: 10px;
}

.panel-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.panel-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

.offline-earnings-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background-color: #2c3e50;
  color: #ecf0f1;
  border: 2px solid #3498db;
  border-radius: 10px;
  padding: 25px;
  z-index: 1000;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  width: 90%;
  max-width: 400px;
}

.offline-earnings-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.offline-earnings-notification h2 {
  margin-top: 0;
  color: #fff;
  font-size: 1.5em;
}

.offline-earnings-notification p {
  margin: 10px 0;
  font-size: 1.1em;
}

.offline-earnings-notification .ganhos {
  font-size: 1.8em;
  font-weight: bold;
  color: #2ecc71;
  margin-top: 15px;
}

.bitcoin-balance {
    font-weight: 700;
    color: var(--bitcoin-color);
}

.btn-bitcoin {
    width: 100%;
    margin: 16px 0;
    padding: 12px;
    font-size: 16px;
    background-color: var(--bitcoin-color);
    color: var(--white);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}
.btn-bitcoin:hover {
    background-color: #f8a02a;
}

/* Modal Bitcoin */
.bitcoin-modal-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.bitcoin-modal {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    height: 90vh;
    max-height: 700px;
    background: #1a1a1a;
    border: 1px solid var(--bitcoin-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.4s ease forwards;
}

.bitcoin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.bitcoin-modal-header h2 {
    margin: 0;
    color: var(--bitcoin-color);
    font-size: 24px;
}

.bitcoin-modal-close-btn {
    font-size: 32px;
    line-height: 1;
    color: var(--white);
    background: none;
    border: none;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.bitcoin-modal-close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.bitcoin-modal-body {
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}

.bitcoin-prestige-info {
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.bitcoin-prestige-info p {
    margin: 0 0 12px;
    opacity: 0.9;
}

.bitcoin-gain-preview {
    font-size: 28px;
    font-weight: 700;
    color: var(--bitcoin-color);
    margin-bottom: 16px;
}

.btn-prestige {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    background-color: var(--sell-color);
    color: var(--white);
}
.btn-prestige:hover {
    background-color: #c62828;
}

.price-bitcoin .price {
    color: var(--bitcoin-color);
}


@media (max-width: 900px) {
  body {
    display: flex;
    flex-direction: column;
  }
  .update-popup-header h2 {
    margin: 0;
    font-size: 18px;
  }
  .topbar {
    display: none;
  }

  .layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: auto;
    min-height: 0;
    padding: 10px;
    gap: 10px;
  }

  .hud-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    order: 2;
    padding: 6px;
    background: var(--bg-overlay);
    border: 1px solid var(--border);
    border-radius: 12px;
  }

  .hud-mobile .money {
    font-size: 18px;
  }

  .hud-mobile .mps {
    font-size: 14px;
  }

  #left-panel {
    order: 1;
    flex-direction: column;
  }

  .click-area {
    order: 3;
    flex:1;
    min-height: 140px;
    overflow: hidden;
  }

  .click-area .note {
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    padding: 12px;
  }

  #loja-container {
    order: 4;
  }

  .panel {
    height: auto;
    padding: 10px;
  }

  .panel-title {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .panel-content {
    padding-bottom: 6px;
  }

  .panel-item {
    grid-template-columns: 48px 1fr;
    gap: 8px;
    padding: 8px;
    margin-bottom: 8px;
  }

  .panel-icon {
    width: 48px;
    height: 48px;
  }

  .panel-body {
    gap: 4px;
  }

  .panel-name {
    font-size: 15px;
  }

  .price {
    font-size: 14px;
  }

  .stat {
    font-size: 12px;
  }

  .panel-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .site-footer {
    position: static;
    flex-shrink: 0;
    margin-top: auto;
    padding: 8px;
    background: var(--bg-overlay);
    border-top: 1px solid var(--border);
    font-size: 12px;
    gap: 15px;
  }

}