/* KOCCHUB member hub — rich cosmic purple (matches live /hub look) */
:root {
  --gold: #FFD700;
  --gold-soft: #ffe566;
  --gold-deep: #c9a227;
  --ink: #0a0014;
  --panel: rgba(28, 6, 58, 0.78);
  --panel-solid: rgba(36, 10, 72, 0.88);
  --line: rgba(255, 215, 0, 0.38);
  --text: #fff8ff;
  --muted: #d9c8f5;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Manrope, system-ui, sans-serif;
  background-color: #16002a;
  background-image:
    radial-gradient(ellipse 70% 45% at 15% 10%, rgba(192, 38, 211, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 20%, rgba(59, 130, 246, 0.28), transparent 50%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(124, 58, 237, 0.4), transparent 55%),
    linear-gradient(180deg, rgba(10, 0, 24, 0.35), rgba(10, 0, 24, 0.55)),
    url("../assets/cosmic-backdrop.webp");
  background-size: auto, auto, auto, auto, cover;
  background-position: center, center, center, center, center top;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
a { color: var(--gold); }
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  height: auto;
  min-height: 70px;
  border-bottom: 2px solid #4b0082;
  background: rgba(13, 11, 20, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 99999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}
.logo {
  font-family: Cinzel, serif;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-decoration: none;
  font-size: 1.2rem;
  text-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo.kocchub-mark .kocc {
  color: #FFD700;
  text-shadow: 0 1px 0 #fff4b0, 0 2px 0 #d4af37, 0 0 10px rgba(255, 215, 0, 0.35);
}
.logo.kocchub-mark .hub {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.logo span { color: #FFD700; }
.logo img,
.logo .kocchub-crown {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2)); background: transparent;
}
.nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nav a {
  text-decoration: none;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 14px !important;
  border-radius: 6px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  color: #fff !important;
}
.nav-btn-purple {
  background: linear-gradient(135deg, #4b0082 0%, #6a0dad 100%);
  border: 1px solid #9370db;
}
.nav-btn-purple:hover, .nav-btn-purple.active {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(147,112,219,0.5);
  background: linear-gradient(135deg, #5a049c 0%, #7b12cc 100%);
}
.nav-btn-green {
  background: linear-gradient(135deg, #0d5c3a 0%, #11754b 100%);
  border: 1px solid #2ecc71;
}
.nav-btn-green:hover, .nav-btn-green.active {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46,204,113,0.5);
  background: linear-gradient(135deg, #117a4d 0%, #169c64 100%);
}
.nav-btn-red {
  background: linear-gradient(135deg, #7a0c1e 0%, #a6122d 100%);
  border: 1px solid #ef4444;
}
.nav-btn-red:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239,68,68,0.5);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle .bar {
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition: 0.3s ease;
}
.nav-toggle.open .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }
@media (max-width: 1024px) {
  .nav-toggle { display: flex; order: 2; }
  .userbox { order: 3; width: 100%; }
  .nav {
    order: 4;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0 4px;
    gap: 10px;
  }
  .nav.open { display: flex; }
  .nav a { width: 100%; box-sizing: border-box; font-size: 0.92rem !important; padding: 12px 16px !important; }
}
.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.84rem;
  color: #efe3ff;
}
.userbox strong {
  color: #FFD700;
  font-weight: 800;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
  word-break: break-all;
}
.userbox .session-tag {
  color: #bfaecf;
  font-size: 0.72rem;
  font-weight: 600;
}
.hub-signout,
.userbox .out {
  border: 1px solid var(--gold);
  color: var(--gold);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 800;
  background: rgba(20, 0, 40, 0.55);
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.hub-signout:hover,
.userbox .out:hover {
  background: rgba(255, 215, 0, 0.12);
}
@media (max-width: 1024px) {
  .userbox {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }
  .hub-signout {
    margin-left: auto;
    min-height: 40px;
    padding: 10px 14px;
  }
  #hubLogout {
    order: 99;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 215, 0, 0.28);
    padding-top: 14px !important;
  }
}
.userbox .out {
  border: 1px solid var(--gold);
  color: var(--gold);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 800;
  background: rgba(20, 0, 40, 0.55);
}
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 18px;
  padding: 20px 16px 40px;
  max-width: 1240px;
  margin: 0 auto;
}
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.panel {
  background: var(--panel);
  border: 1px solid rgba(167, 112, 255, 0.35);
  border-radius: 16px;
  padding: 18px;
  backdrop-filter: blur(16px);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
h1, h2 {
  font-family: Cinzel, serif;
  color: var(--gold);
  margin: 0 0 8px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}
.muted { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.desk {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.18);
}
.desk-chart {
  width: 100%;
  height: 110px;
  margin: 8px 0 4px;
  border-radius: 12px;
  border: 1px solid rgba(147, 112, 219, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 215, 0, 0.06), transparent 60%),
    repeating-linear-gradient(90deg, transparent 0 28px, rgba(255,255,255,0.04) 28px 29px),
    rgba(10, 0, 24, 0.45);
  position: relative;
  overflow: hidden;
}
.desk-chart svg { width: 100%; height: 100%; display: block; }
.prices { font-weight: 800; text-align: right; }
.prices span { display: block; color: var(--gold-soft); margin-top: 6px; font-size: 0.95rem; }
.grid-balances {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 10px;
}
@media (max-width: 720px) { .grid-balances { grid-template-columns: 1fr 1fr; } }
.bal {
  background: linear-gradient(165deg, rgba(58, 16, 110, 0.95), rgba(24, 4, 52, 0.92));
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 12px;
  padding: 14px 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}
.bal label {
  display: block;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.bal b {
  display: block;
  margin-top: 8px;
  color: var(--gold-soft);
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}
.note-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(16, 0, 36, 0.55);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}
.drawer h2 {
  font-size: 0.92rem;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}
.drawer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  color: #f4ecff;
  text-decoration: none;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}
.drawer a:hover { color: var(--gold); }
.drawer a .ico {
  width: 18px;
  text-align: center;
  color: var(--gold);
  flex-shrink: 0;
}
.btn {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #ffe566, #ffd700);
  color: #2a0860;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(255, 215, 0, 0.32);
}
.btn:hover { filter: brightness(1.05); }
.btn.ghost {
  background: rgba(20, 0, 40, 0.45);
  border: 1px solid var(--gold);
  color: var(--gold);
  box-shadow: none;
}
.coins { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.coins button {
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(24, 4, 52, 0.85);
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
}
.coins button.active {
  background: linear-gradient(180deg, #ffe566, #ffd700);
  color: #2a0860;
}
.claim-box { text-align: center; margin: 22px 0 12px; }
.claim-box .amt {
  font-size: 1.65rem;
  color: var(--gold-soft);
  font-weight: 900;
  margin: 10px 0;
  text-shadow: 0 0 24px rgba(255, 215, 0, 0.28);
}
.claim-meta { color: var(--muted); font-size: 0.84rem; margin-top: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input { flex: 1; min-width: 180px; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(167, 112, 255, 0.4);
  background: rgba(10, 0, 24, 0.7);
  color: #fff;
  font-weight: 700;
  margin: 6px 0 10px;
}
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th {
  color: var(--gold);
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; position: relative; z-index: 2; }
.pill-row button {
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(24, 4, 52, 0.85);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 3;
  -webkit-tap-highlight-color: transparent;
}
.pill-row button.active {
  background: linear-gradient(180deg, #ffe566, #ffd700);
  color: #2a0860;
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.35);
}



.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0}
@media(max-width:700px){.form-grid{grid-template-columns:1fr}}
.form-grid label,.muted{color:var(--muted)}
.form-grid input,.form-grid select,.form-grid textarea,input,select,textarea{
  width:100%;padding:10px;border-radius:8px;border:1px solid rgba(167,112,255,.35);
  background:rgba(10,0,24,.55);color:#fff;font-weight:700
}
.pill-row{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0;position:relative;z-index:2}
.pill-row button{border:1px solid rgba(167,112,255,.35);background:rgba(20,0,40,.5);color:#efe3ff;border-radius:999px;padding:8px 12px;font-weight:800;cursor:pointer;pointer-events:auto;position:relative;z-index:3;-webkit-tap-highlight-color:transparent}
.pill-row button.active{background:linear-gradient(180deg,#ffe566,#ffd700);color:#2a0860;box-shadow:0 0 0 2px rgba(255,215,0,.35)}
.grid-balances{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px;margin:12px 0}
.grid-balances .bal{background:rgba(10,0,24,.45);border:1px solid rgba(167,112,255,.3);border-radius:10px;padding:10px}
.grid-balances label{display:block;font-size:.72rem;color:var(--muted);font-weight:800}
.grid-balances b{color:var(--gold)}
table{width:100%;border-collapse:collapse;font-size:.84rem}
th,td{padding:8px;border-bottom:1px solid rgba(147,112,219,.25);text-align:left}
th{color:var(--gold)}
.btn.ghost{background:transparent;border:1px solid var(--gold);color:var(--gold)}

/* RESPONSIVE DEVICES — phone tablet desktop */
@media (max-width: 1024px) {
  .site-header { padding: 10px 12px; }
  .nav a { padding: 8px 10px !important; font-size: 0.72rem !important; }
}
@media (max-width: 768px) {
  html, body { background-attachment: scroll; }
  .site-header { gap: 8px; }
  .logo { font-size: 1.05rem; }
  .logo img, .logo .kocchub-crown { width: 28px; height: 28px; }
  .nav { width: 100%; justify-content: flex-start; gap: 6px; }
  .nav a { min-height: 40px; padding: 8px 10px !important; font-size: 0.7rem !important; }
  .main, .content, .page { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 480px) {
  .nav a { flex: 1 1 auto; justify-content: center; font-size: 0.65rem !important; padding: 8px 6px !important; }
}

/* Hub ad slots — tidy centered strips, no scatter */
.top-ad {
  background: linear-gradient(90deg, #2a0860, #4a00a0 50%, #2a0860);
  color: #FFD700;
  text-align: center;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  box-shadow: none;
  border-bottom: 1px solid rgba(255,215,0,0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.top-ad button {
  margin-left: 10px;
  border: 1px solid #FFD700;
  border-radius: 999px;
  padding: 5px 12px;
  background: linear-gradient(180deg, #ffe566, #d4af37);
  color: #1a0538;
  font-weight: 800;
  cursor: pointer;
}
.kocc-ad-top, .kocc-ad-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  background: #0d0220;
  border-bottom: 1px solid rgba(255,215,0,0.15);
  box-sizing: border-box;
}
.kocc-ad-bottom {
  border-bottom: none;
  border-top: 1px solid rgba(255,215,0,0.15);
  margin-top: 24px;
  padding-bottom: 16px;
}
.kocc-ad-frame {
  max-width: 100%;
  overflow: hidden;
  line-height: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,215,0,0.3);
  background: #12032a;
}
.kocc-ad-frame iframe {
  display: block;
  max-width: 100%;
  vertical-align: top;
}


a.kocc-ad-frame { display: inline-block; text-decoration: none; line-height: 0; }
a.kocc-ad-frame img { display: block; border: 0; }

/* device-publish-20260915 */
@media (max-width: 768px) {
  .btn, button.btn, a.btn { min-height: 44px; }
  .site-header nav a { padding: 10px 12px; }
  .panel { border-radius: 14px; }
  input, select, textarea { min-height: 44px; }
}
@media (min-width: 769px) and (max-width: 1100px) {
  .layout { padding-left: 12px; padding-right: 12px; }
}

/* ===== Device polish 2026-09-16: phone · tablet · desktop ===== */
.layout {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px;
}
.panel {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { display: block; width: 100%; overflow-x: auto; }
.btn, button.btn, a.btn, .btn.ghost {
  touch-action: manipulation;
  max-width: 100%;
}
img, video, iframe { max-width: 100%; height: auto; }

/* Tablet */
@media (min-width: 701px) and (max-width: 1100px) {
  .layout { grid-template-columns: 1fr 280px; gap: 14px; padding: 14px; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .tier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .panel h1 { font-size: 1.45rem; }
  .drawer { position: sticky; top: 84px; }
}

/* Phone */
@media (max-width: 700px) {
  .layout {
    display: block !important;
    grid-template-columns: 1fr !important;
    padding: 10px;
  }
  .drawer { margin-top: 14px; }
  .form-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .tier-grid { grid-template-columns: 1fr 1fr !important; gap: 8px; }
  .grid-balances { grid-template-columns: 1fr !important; }
  .panel { padding: 14px; margin: 0 0 12px; }
  .panel h1 { font-size: 1.28rem; line-height: 1.25; }
  .panel h2 { font-size: 1.02rem; }
  .btn, .btn.ghost, button.btn {
    width: 100%;
    margin: 6px 0;
    justify-content: center;
    text-align: center;
  }
  .top-ad { font-size: 0.78rem; padding: 8px; }
  .userbox { justify-content: space-between; }
  .order-box, .note-box, .rail-hint { font-size: 0.8rem; word-break: break-word; }
  input, select, textarea { font-size: 16px !important; /* prevent iOS zoom */ }
}

/* Large desktop */
@media (min-width: 1101px) {
  .layout { padding: 20px 24px; }
  .tier-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}

/* Safe areas (notched phones) */
@supports (padding: max(0px)) {
  .site-header {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  body {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}
