/* ============================================================================
   JC Compass V3.2 - Stylesheet (Gold Unified)
   ============================================================================
   Design: Three-needle alarm clock with unified gold needles.
   Direction = angle (not color). BUY/SELL = ball color only.
   Logo JC rendered as one unified mark.
   ============================================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background: #0a0f1a;
  color: #E5E7EB;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
               'Helvetica Neue', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; }

.hidden { display: none !important; }

/* ---------- Brand logo (unified JC mark, single unit) ---------- */

.brand-logo {
  display: inline-flex;
  align-items: baseline;
  font-family: Georgia, 'DM Serif Display', serif;
  line-height: 1;
  letter-spacing: -1.5px;
}

.brand-logo .jc-j {
  color: #F5F7FA;
  font-weight: 200;
  font-size: 28px;
}

.brand-logo .jc-c {
  color: #C8A44E;
  font-weight: 500;
  font-size: 28px;
}

.brand-logo-sm .jc-j { font-size: 22px; }
.brand-logo-sm .jc-c { font-size: 22px; }

.brand-word {
  font-family: Georgia, 'DM Serif Display', serif;
  font-size: 11px;
  color: #C8A44E;
  letter-spacing: 3px;
  font-weight: 400;
  margin-left: 8px;
  align-self: baseline;
}

.brand-name-ch {
  margin-top: 0.5rem;
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  letter-spacing: 6px;
  color: #F5F7FA;
}

.brand-name-en {
  margin-top: 0.25rem;
  font-size: 11px;
  letter-spacing: 3px;
  color: #C8A44E;
  font-weight: 600;
}

/* ---------- Landing page ---------- */

body.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.landing-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slogan {
  text-align: center;
  font-family: Georgia, 'DM Serif Display', serif;
  font-style: italic;
  font-size: 16px;
  color: #C8A44E;
  line-height: 1.5;
  margin: 0.5rem 0 1rem;
}

.notice {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}

.notice-ok {
  background: rgba(74, 222, 128, 0.1);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.notice-err {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.access-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.access-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.access-form .lbl {
  font-size: 11px;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.access-form input {
  background: #151a26;
  border: 1px solid #3d4a60;
  color: #E5E7EB;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}

.access-form input:focus { border-color: #C8A44E; }

.btn-primary {
  background: #C8A44E;
  color: #0a0f1a;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn-primary:hover { background: #D4B266; }

.footer {
  margin-top: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.jc-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  justify-content: center;
  font-size: 12px;
  color: #9CA3AF;
}

.jc-mini-j { font-size: 11px; font-weight: 200; color: #F5F7FA; }
.jc-mini-c { font-size: 11px; font-weight: 500; color: #C8A44E; }
.jc-capital { color: #C8A44E; letter-spacing: 1px; font-weight: 500; }
.invited { color: #6b7280; font-size: 11px; }

.disclaimer {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.5;
}

.version { color: #4b5563; }

/* ---------- App main layout (V3.2 Gold Unified) ---------- */

body.app {
  padding: 0;
  background: #0a0f1a;
}

.app-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 8px;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.signal-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
  transition: background 0.3s, box-shadow 0.3s;
}

.signal-pulse.pulse-off {
  background: #6b7280;
  opacity: 0.35;
}

.signal-pulse.pulse-green {
  background: #10b981;
  box-shadow: 0 0 5px rgba(16, 185, 129, 0.6);
}

.signal-pulse.pulse-yellow {
  background: #fb923c;
  box-shadow: 0 0 5px rgba(251, 146, 60, 0.7);
}

.signal-pulse.pulse-red {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
}

.ticker-switch {
  display: inline-flex;
  background: transparent;
  border: 0.5px solid rgba(200, 164, 78, 0.4);
  border-radius: 5px;
  overflow: hidden;
}

.ticker-btn {
  background: transparent;
  color: #C8A44E;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  font-family: system-ui, -apple-system, sans-serif;
  border: none;
  cursor: pointer;
  opacity: 0.45;
  transition: all 0.15s;
}

.ticker-btn.active {
  background: #C8A44E;
  color: #0a0f1a;
  opacity: 1;
}

/* ---------- Clock card (V3.2: flex-centered, padding lowered) ---------- */

.clock-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 20px 16px;
  position: relative;
}

#clock-svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
}

/* Needle color classes removed - all needles are gold in V3.2.
   Rotation applied via SVG rotate attribute in compass.js.
   NO CSS transform (R31 - V2.4 locked rule). */

.needle {
  stroke: #C8A44E;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
  transition: none;
}

/* Balls: all three identical. Size matches 15M (r=4). */
.ball {
  display: none;
  stroke: none;
}

.ball.ball-active {
  display: inline;
}

.ball.buy { fill: #10b981; }
.ball.sell { fill: #ef4444; }

.ball-highlight {
  display: none;
  pointer-events: none;
  opacity: 0.9;
}

.ball-highlight.active {
  display: inline;
}

.ball-highlight.buy { fill: #ecfdf5; }
.ball-highlight.sell { fill: #fef2f2; }

/* ---------- Rows card (V3.2: all TF + TICKER gold unified) ---------- */

.rows-card {
  width: 100%;
  max-width: 280px;
  margin: 20px auto 0;
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
  font-size: 12px;
}

.row {
  display: grid;
  grid-template-columns: 36px 44px 1fr 42px 42px;
  gap: 6px;
  padding: 6px 2px;
  align-items: center;
}

.col-tf {
  color: #C8A44E;
  font-weight: 500;
}

.col-ticker {
  color: #C8A44E;
  font-weight: 500;
}

.col-price {
  color: #E5E7EB;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.col-action {
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.col-hhmm {
  color: #9CA3AF;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.row.placeholder .col-tf,
.row.placeholder .col-ticker,
.row.placeholder .col-price,
.row.placeholder .col-action,
.row.placeholder .col-hhmm {
  color: #6b7280;
  opacity: 0.7;
}

.col-action.BUY { color: #10b981; }
.col-action.SELL { color: #ef4444; }

/* ---------- Footer (V3.2: pushed to bottom with gold divider) ---------- */

.app-footer {
  padding: 14px 20px 18px;
  text-align: center;
  border-top: 0.5px solid rgba(200, 164, 78, 0.1);
}

.slogan-small {
  font-family: Georgia, 'DM Serif Display', serif;
  font-style: italic;
  font-size: 12px;
  color: #C8A44E;
  line-height: 1.55;
  margin-bottom: 8px;
}

.footer-brand {
  display: none;
}

.disclaimer-small {
  font-size: 9.5px;
  color: #6b7280;
  line-height: 1.5;
  padding: 0 0.5rem;
}

.disclaimer-small .separator {
  display: inline-block;
  margin: 0 4px;
  opacity: 0.5;
}

.disclaimer-small .version-tag {
  color: #4b5563;
}

/* ---------- Error banner ---------- */

.error-banner {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: #f87171;
  color: #0a0f1a;
  padding: 0.5rem;
  text-align: center;
  font-weight: 500;
  font-size: 12px;
  z-index: 1000;
}

/* ---------- Responsive ---------- */

@media (min-width: 480px) {
  .app-wrap {
    max-width: 440px;
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-radius: 16px;
    overflow: hidden;
    border: 0.5px solid rgba(200, 164, 78, 0.15);
    min-height: calc(100vh - 2rem);
  }
}

@media (min-width: 768px) {
  .clock-card { padding: 36px 24px 20px; }
  #clock-svg { max-width: 320px; }
  .rows-card {
    max-width: 320px;
    font-size: 13px;
  }
}
