






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

html, body {
  width: 100%;
  height: 100%;
  font-family: Arial, sans-serif;
  background: #111;
  overflow: hidden;
}

.page {
  position: relative;
  width: 100%;
  height: 100vh;
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.overlay {
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 1000;
  width: clamp(320px, 30vw, 520px);
  min-width: 280px;
  max-width: min(92vw, 520px);
  background: rgba(0, 0, 0, 0.74);
  color: white;
  padding: clamp(16px, 2vw, 24px);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  display: grid;
  gap: clamp(10px, 1.2vw, 16px);
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.overlay h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  margin: 0;
  letter-spacing: 1px;
  font-weight: 800;
  text-align: center;
}

.intro {
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  line-height: 1.5;
  color: #e7e7e7;
  margin: 0;
  text-align: left;
}

.tagline {
  margin: 0;
  font-size: clamp(0.82rem, 1.1vw, 0.95rem);
  color: #b9c7d3;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  text-align: center;
}

.field-label {
  display: block;
  font-size: clamp(0.82rem, 1vw, 0.92rem);
  margin: 0 0 6px;
  color: #d7d7d7;
  text-align: left;
}

#passcode {
  width: 100%;
  padding: clamp(12px, 1.2vw, 15px) clamp(14px, 1.4vw, 18px);
  border-radius: 10px;
  border: none;
  outline: none;
  font-size: clamp(0.96rem, 1.2vw, 1.08rem);
  margin: 0;
}

.button-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: clamp(10px, 1vw, 14px);
  align-items: stretch;
}

button {
  border: none;
  border-radius: 10px;
  padding: clamp(12px, 1.2vw, 15px) clamp(14px, 1.4vw, 18px);
  font-size: clamp(0.92rem, 1.15vw, 1.02rem);
  cursor: pointer;
  transition: 0.15s ease;
  min-height: 46px;
}

.primary-btn {
  background: white;
  color: #111;
  font-weight: bold;
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.secondary-btn {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.14);
}

.secondary-btn:hover {
  background: rgba(255,255,255,0.18);
}

.secondary-btn:disabled,
.primary-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.status-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  font-size: 0.92rem;
  line-height: 1.4;
  color: #f1f1f1;
  min-height: 52px;
}

.live-count {
  margin: 0;
  font-size: clamp(0.84rem, 1vw, 0.92rem);
  color: #d7d7d7;
  letter-spacing: 0.3px;
  text-align: center;
}

.pot-counter {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.78);
  color: white;
  padding: 14px 18px;
  border-radius: 14px;
  min-width: 220px;
  text-align: right;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.pot-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: #cfcfcf;
  margin-bottom: 4px;
}

.pot-value {
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
}

.pot-sub {
  margin-top: 6px;
  font-size: 0.85rem;
  color: #d9d9d9;
}

@media (max-width: 700px) {
  .overlay {
    top: 16px;
    left: 16px;
    width: min(calc(100% - 32px), 520px);
    max-width: calc(100% - 32px);
  }

  .overlay h1 {
    font-size: 1.75rem;
  }

  .button-row {
    flex-direction: column;
  }

  .pot-counter {
    right: 14px;
    left: 14px;
    bottom: 14px;
    min-width: 0;
  }

  .pot-value {
    font-size: 1.6rem;
  }
}

.market-modal.hidden {
  display: none;
}

.market-modal {
  position: absolute;
  inset: 0;
  z-index: 3000;
}

.market-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.market-modal-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(960px, calc(100% - 40px));
  max-height: calc(100vh - 40px);
  transform: translate(-50%, -50%);
  background: rgba(10, 14, 18, 0.96);
  color: white;
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  padding: 24px;
  overflow: auto;
}

.market-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.market-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.market-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
  padding-right: 52px;
}

.market-header h2 {
  font-size: 2rem;
  margin: 0 0 4px;
}

.market-header p {
  margin: 0;
  color: #b8c4d0;
}

.market-event {
  background: rgba(255, 255, 255, 0.08);
  color: #f0f5fa;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.3;
  white-space: nowrap;
}

.market-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  color: #d7e0e8;
  font-size: 0.95rem;
}

.chart-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.chart-toolbar button {
  min-width: 64px;
}

.chart-shell {
  display: flex;
  gap: 14px;
  align-items: stretch;
  min-height: 420px;
  margin-bottom: 18px;
}

.chart-price-scale {
  width: 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #95a4b2;
  font-size: 0.9rem;
  text-align: right;
  padding: 6px 0;
}

.chart-area {
  position: relative;
  flex: 1;
  min-height: 420px;
  border-radius: 16px;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.chart-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 20%, 8% 100%;
  pointer-events: none;
}

.chart-candles {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 22px 24px 28px;
  transform-origin: center center;
  transition: transform 0.18s ease;
}

.fake-candle {
  position: relative;
  width: 18px;
  flex: 0 0 auto;
}

.fake-candle-wick {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 999px;
}

.fake-candle-body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  border-radius: 4px;
}

.fake-candle.up .fake-candle-body {
  background: #45c486;
}

.fake-candle.down .fake-candle-body {
  background: #dd5f72;
}

.market-bottom-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.market-selected {
  color: #d5dfe8;
  font-size: 0.96rem;
  line-height: 1.35;
}

.market-marker-label {
  background: rgba(8, 12, 18, 0.92);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

@media (max-width: 820px) {
  .market-modal-panel {
    width: calc(100% - 20px);
    max-height: calc(100vh - 20px);
    padding: 18px;
  }

  .market-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .market-event {
    white-space: normal;
  }

  .chart-shell {
    flex-direction: column;
    min-height: 0;
  }

  .chart-price-scale {
    width: 100%;
    flex-direction: row;
    text-align: left;
  }

  .chart-area {
    min-height: 320px;
  }

  .market-bottom-row {
    flex-direction: column;
    align-items: stretch;
  }

    .auditor-panel.hidden {
      display: none;
    }
  
    .auditor-panel {
      position: absolute;
      inset: 0;
      z-index: 4100;
      background: rgba(0, 0, 0, 0.55);
      backdrop-filter: blur(4px);
    }
  
    .auditor-panel-inner {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: min(900px, calc(100% - 30px));
      max-height: calc(100vh - 30px);
      overflow: auto;
      background: rgba(10, 14, 18, 0.97);
      color: white;
      border-radius: 18px;
      padding: 24px;
    }
  
    .auditor-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
      margin-top: 16px;
    }
  
    .auditor-grid label {
      display: flex;
      flex-direction: column;
      gap: 6px;
      color: #d7e0e8;
      font-size: 0.92rem;
    }
  
    .auditor-grid input,
    .auditor-grid textarea {
      width: 100%;
      padding: 10px 12px;
      border-radius: 10px;
      border: none;
      font: inherit;
    }
  
    .audit-check {
      flex-direction: row !important;
      align-items: center;
      gap: 10px !important;
    }
  
    .auditor-actions {
      display: flex;
      gap: 10px;
      margin-top: 18px;
    }
  
    .audit-output {
      margin-top: 18px;
      padding: 14px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 12px;
      color: #dce6ef;
      white-space: pre-wrap;
      word-break: break-word;
    }

    
        .overlay>* {
          margin: 0;
        }
    
        .overlay input,
        .overlay textarea,
        .overlay button,
        .overlay .status-box,
        .overlay .live-count,
        .overlay .policy-check-wrap {
          width: 100%;
        }
    
        .overlay.dragging {
          cursor: grabbing;
        }
    
        .overlay.dragging * {
          cursor: grabbing !important;   
        }


  
    @media (max-width: 760px) {
      .auditor-grid {
        grid-template-columns: 1fr;
      } }
}