/**
 * JANCOK.AI ARCADE — shared styles for the hub and every new game.
 * Loaded AFTER game.css (which supplies tokens, viewport, modal & leaderboard base).
 */

/* ---------- Shared game-over extras ---------- */
.game-screen-modal { overflow-y: auto; justify-content: safe center; }
.go-cause { font-size: 11px; color: #9aa0a6; margin: -6px 0 12px; }
.go-cause span { color: var(--color-neon-amber); }
.go-save-status { font-size: 11px; margin: -10px 0 14px; min-height: 16px; }

/* ---------- Clickbait banner & ticker ---------- */
.clickbait-banner {
  border: 1px dashed var(--color-neon-red);
  background: rgba(252, 65, 61, 0.07);
  color: var(--color-bone-glow);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.clickbait-banner strong { color: var(--color-neon-amber); letter-spacing: 0.5px; }
.clickbait-banner .blink { color: var(--color-neon-red); animation: jnc-blink 0.9s steps(2) infinite; font-weight: 800; }

.taunt-ticker {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--color-charcoal-vein);
  border-bottom: 1px solid var(--color-charcoal-vein);
  padding: 8px 0;
  margin-bottom: 18px;
  font-size: 11px;
  color: #9aa0a6;
}
.taunt-ticker-track { display: inline-block; padding-left: 100%; animation: jnc-marquee 38s linear infinite; }
.taunt-ticker-track span { margin-right: 48px; }
.taunt-ticker-track span::before { content: "⚠ "; color: var(--color-neon-amber); }

/* ---------- Hub ---------- */
.hub-hero { text-align: left; margin: 8px 0 18px; }
.hub-hero h1 { font-size: clamp(22px, 4.4vw, 38px); line-height: 1.15; letter-spacing: 1px; }
.hub-hero h1 em { font-style: normal; color: var(--color-neon-red); }
.hub-hero p { font-size: 13px; color: #9aa0a6; margin-top: 10px; max-width: 640px; line-height: 1.6; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--color-charcoal-dark);
  border: 1px solid var(--color-charcoal-vein);
  border-radius: 8px;
  color: var(--color-bone-glow);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
  min-height: 190px;
}
.game-card:hover { border-color: var(--card-accent, var(--color-neon-blue)); transform: translateY(-2px); }
.game-card-top { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: #9aa0a6; }
.game-card-icon { font-size: 28px; line-height: 1; }
.game-card-tag {
  font-size: 9px; padding: 2px 8px; border-radius: 9999px;
  border: 1px solid var(--card-accent, var(--color-neon-blue)); color: var(--card-accent, var(--color-neon-cyan));
}
.game-card h2 { font-size: 15px; letter-spacing: 1px; }
.game-card .clickbait { font-size: 12px; font-weight: 700; color: var(--color-neon-amber); line-height: 1.45; }
.game-card .desc { font-size: 11px; color: #9aa0a6; line-height: 1.5; flex: 1; }
.game-card .best { font-size: 10px; color: var(--color-neon-cyan); border-top: 1px solid rgba(60, 60, 56, 0.5); padding-top: 8px; }
.game-card .hot {
  position: absolute; top: -8px; right: 12px; font-size: 9px; font-weight: 800;
  background: var(--color-neon-red); color: #fff; padding: 2px 8px; border-radius: 9999px;
  animation: jnc-wiggle 1.8s ease-in-out infinite;
}

/* ---------- Generic game page ---------- */
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.page-title h1 { font-size: 20px; letter-spacing: 1.5px; }
.page-title h1 span { color: var(--color-neon-cyan); }
.page-title small { font-size: 11px; color: #9aa0a6; }

.game-viewport.portrait { max-width: 460px; }
.game-viewport.square { max-width: 620px; }
.game-viewport canvas.cv-portrait { aspect-ratio: 3 / 4; }
.game-viewport canvas.cv-wide { aspect-ratio: 8 / 5; }
.game-viewport canvas.cv-square { aspect-ratio: 1 / 1; }

.bot-bubble {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  max-width: 86%; background: rgba(18, 19, 15, 0.92); border: 1px solid var(--color-neon-amber);
  color: var(--color-bone-glow); font-size: 12px; padding: 6px 14px; border-radius: 9999px;
  opacity: 0; transition: opacity 0.25s ease; pointer-events: none; text-align: center; z-index: 5;
}
.bot-bubble.show { opacity: 1; }

/* ---------- AI chat games ---------- */
.ai-stage {
  display: grid; grid-template-columns: 220px 1fr; gap: 12px; margin-bottom: 16px;
}
.ai-panel {
  background: var(--color-charcoal-dark); border: 1px solid var(--color-charcoal-vein);
  border-radius: 8px; padding: 14px;
}
.ai-avatar {
  font-size: 64px; text-align: center; line-height: 1.1; margin: 4px 0 8px;
  transition: transform 0.2s ease;
}
.ai-avatar.hit { animation: jnc-shake 0.4s ease; }
.ai-emotion { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.ai-reaction { text-align: center; font-size: 11px; color: var(--color-neon-amber); min-height: 16px; margin-top: 4px; }

.meter { margin-top: 12px; }
.meter-label { display: flex; justify-content: space-between; font-size: 10px; color: #9aa0a6; margin-bottom: 4px; }
.meter-track { height: 10px; border: 1px solid var(--color-charcoal-vein); border-radius: 9999px; overflow: hidden; background: #0c0d0a; }
.meter-fill { height: 100%; width: 100%; background: var(--color-neon-green); transition: width 0.45s ease, background 0.45s ease; }

.stat-line { display: flex; justify-content: space-between; font-size: 11px; margin-top: 8px; color: #9aa0a6; }
.stat-line b { color: var(--color-bone-glow); }

.chat-panel { display: flex; flex-direction: column; min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; max-height: 52vh; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.bubble { max-width: 86%; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.5; word-wrap: break-word; }
.bubble.user { align-self: flex-end; background: rgba(49, 134, 255, 0.16); border: 1px solid rgba(49, 134, 255, 0.4); }
.bubble.ai { align-self: flex-start; background: #10110d; border: 1px solid var(--color-charcoal-vein); }
.bubble.sys { align-self: center; font-size: 11px; color: #9aa0a6; border: 1px dashed var(--color-charcoal-vein); }
.bubble .meta { display: block; font-size: 10px; margin-top: 4px; color: var(--color-neon-amber); }
.bubble.typing { color: #9aa0a6; font-style: italic; }

.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input, .chat-form textarea, .text-input, .select-input {
  flex: 1; background: var(--color-midnight-carbon); color: var(--color-bone-glow);
  border: 1px solid var(--color-charcoal-vein); border-radius: 8px; padding: 10px 12px;
  font-family: var(--font-mono); font-size: 13px; outline: none; resize: none;
}
.chat-form input:focus, .chat-form textarea:focus, .text-input:focus, .select-input:focus { border-color: var(--color-neon-cyan); }
.chat-form button, .btn-solid {
  font-family: var(--font-mono); font-weight: 700; font-size: 12px; padding: 10px 16px; border: none; border-radius: 8px;
  background: var(--color-neon-blue); color: #fff; cursor: pointer;
}
.chat-form button:disabled, .btn-solid:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  font-family: var(--font-mono); font-size: 12px; padding: 10px 16px; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--color-bone-glow); border: 1px solid var(--color-charcoal-vein);
}
.btn-ghost:hover { border-color: var(--color-bone-glow); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  font-family: var(--font-mono); font-size: 11px; padding: 5px 10px; border-radius: 9999px; cursor: pointer;
  background: transparent; border: 1px solid var(--color-charcoal-vein); color: #c9c4bf;
}
.chip:hover { border-color: var(--color-neon-cyan); color: var(--color-neon-cyan); }

/* Runaway "give up" button — intentionally ngeselin */
.runaway-zone { position: relative; height: 44px; margin-top: 10px; }
.runaway-btn {
  position: absolute; left: 0; top: 6px; font-family: var(--font-mono); font-size: 11px; padding: 6px 12px;
  border-radius: 9999px; border: 1px solid var(--color-neon-red); color: var(--color-neon-red); background: transparent;
  cursor: pointer; transition: left 0.18s ease;
}

/* Result overlay */
.result-overlay {
  position: fixed; inset: 0; background: rgba(18, 19, 15, 0.94); z-index: 50; display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.result-overlay.hidden { display: none; }
.result-box {
  width: 100%; max-width: 520px; background: var(--color-charcoal-dark); border: 1px solid var(--color-charcoal-vein);
  border-radius: 10px; padding: 22px; text-align: center;
}
.result-box h2 { font-size: 22px; letter-spacing: 1.5px; margin-bottom: 8px; }
.result-box p { font-size: 13px; color: #c9c4bf; line-height: 1.6; margin-bottom: 14px; }
.result-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* Roast battle HP */
.hp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.hp-card { background: var(--color-charcoal-dark); border: 1px solid var(--color-charcoal-vein); border-radius: 8px; padding: 12px; }
.hp-card h3 { font-size: 12px; letter-spacing: 1px; display: flex; justify-content: space-between; }
.dmg-pop { font-size: 11px; color: var(--color-neon-red); min-height: 16px; margin-top: 6px; }

/* Tebak answers */
.answer-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.answer-row button { padding: 12px 6px; }
.answer-yes { background: var(--color-neon-green) !important; color: #04130a !important; }
.answer-no { background: var(--color-neon-red) !important; }
.answer-idk { background: var(--color-charcoal-vein) !important; }
.answer-maybe { background: var(--color-neon-amber) !important; color: #1b1500 !important; }
.guess-card {
  border: 1px solid var(--color-neon-amber); background: rgba(254, 199, 0, 0.07); border-radius: 8px;
  padding: 14px; text-align: center; margin-top: 10px;
}
.guess-card .guess-name { font-size: 22px; font-weight: 800; color: var(--color-neon-amber); margin: 6px 0; }

/* Karma wheel */
.karma-layout { display: grid; grid-template-columns: minmax(0, 420px) 1fr; gap: 16px; align-items: start; margin-bottom: 24px; }
.wheel-wrap { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.wheel-wrap canvas { width: 100%; height: auto; aspect-ratio: 1 / 1; display: block; }
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid var(--color-neon-red);
  filter: drop-shadow(0 2px 6px rgba(252, 65, 61, 0.6));
}
.karma-form { display: grid; gap: 8px; margin-top: 12px; }
.ramalan-card { background: var(--color-charcoal-dark); border: 1px solid var(--color-charcoal-vein); border-radius: 10px; padding: 18px; }
.ramalan-card h2 { font-size: 16px; color: var(--color-neon-amber); line-height: 1.35; margin-bottom: 10px; }
.ramalan-card p { font-size: 13px; line-height: 1.65; color: var(--color-bone-glow); }
.ramalan-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ramalan-meta div { background: #0e0f0b; border: 1px solid var(--color-charcoal-vein); border-radius: 6px; padding: 8px; font-size: 11px; color: #9aa0a6; }
.ramalan-meta b { display: block; color: var(--color-bone-glow); font-size: 13px; margin-top: 2px; }

/* Blackjack */
.bj-table {
  background: radial-gradient(ellipse at center, #10241a 0%, #0a140f 70%);
  border: 1px solid var(--color-charcoal-vein); border-radius: 12px; padding: 18px; margin-bottom: 14px; min-height: 420px;
}
.bj-row { margin-bottom: 18px; }
.bj-row-head { display: flex; justify-content: space-between; font-size: 11px; color: #9aa0a6; margin-bottom: 8px; }
.bj-row-head b { color: var(--color-bone-glow); }
.bj-hand { display: flex; gap: 8px; flex-wrap: wrap; min-height: 96px; }
.pcard {
  width: 64px; height: 92px; border-radius: 7px; background: #f4f1ec; color: #111; position: relative;
  font-weight: 800; font-size: 15px; padding: 5px 6px; animation: jnc-deal 0.25s ease;
}
.pcard.red { color: #c5221f; }
.pcard .pc-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.pcard .pc-corner-b { position: absolute; right: 6px; bottom: 5px; transform: rotate(180deg); }
.pcard.back { background: repeating-linear-gradient(45deg, #1b2d6b, #1b2d6b 6px, #3186ff 6px, #3186ff 12px); border: 2px solid #f4f1ec; }
.dealer-bubble {
  background: rgba(18, 19, 15, 0.85); border: 1px solid var(--color-neon-amber); border-radius: 10px;
  padding: 8px 12px; font-size: 12px; margin: 6px 0 16px; min-height: 36px;
}
.bj-status { text-align: center; font-size: 16px; font-weight: 800; letter-spacing: 1px; min-height: 24px; margin: 8px 0; }
.bj-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bj-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.chip-btn {
  width: 58px; height: 58px; border-radius: 50%; border: 3px dashed rgba(255, 255, 255, 0.7); cursor: pointer;
  font-family: var(--font-mono); font-weight: 800; font-size: 12px; color: #fff;
}
.chip-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.bank-line { display: flex; justify-content: center; gap: 18px; font-size: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.bank-line b { color: var(--color-neon-amber); font-size: 15px; }

/* Effects */
.shake { animation: jnc-shake 0.4s ease; }
.glitch { animation: jnc-glitch 0.6s steps(2) 3; }

@keyframes jnc-blink { 50% { opacity: 0; } }
@keyframes jnc-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes jnc-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes jnc-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes jnc-glitch { 0% { filter: hue-rotate(0); transform: translate(0); } 50% { filter: hue-rotate(120deg) saturate(3); transform: translate(3px, -2px); } 100% { filter: hue-rotate(0); transform: translate(0); } }
@keyframes jnc-deal { from { transform: translateY(-20px) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 760px) {
  .ai-stage, .karma-layout { grid-template-columns: 1fr; }
  .ai-avatar { font-size: 48px; }
  .chat-log { max-height: 46vh; }
  .answer-row { grid-template-columns: repeat(2, 1fr); }
  .pcard { width: 52px; height: 76px; font-size: 13px; }
  .pcard .pc-center { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .taunt-ticker-track, .game-card .hot, .clickbait-banner .blink { animation: none; }
}
