@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Share+Tech+Mono&display=swap');

.csm-root {
  --csm-green: #00FF41;
  --csm-magenta: #FF00FF;
  --csm-cyan: #00FFFF;
  --csm-orange: #FF6600;
  --csm-bg: #0a0a0a;

  font-family: 'Orbitron', monospace;
  background: var(--csm-bg);
  color: white;
  overflow: hidden;
  height: 100%;
  width: 100%;
  position: relative;
  min-height: 100vh;
}

#csm-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.csm-grid-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    linear-gradient(rgba(0,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,255,0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 1;
}

.csm-scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15),
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  pointer-events: none;
  z-index: 1000;
  animation: csm-scanlineFlicker 0.1s infinite;
}

@keyframes csm-scanlineFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.98; }
}

.csm-noise {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Corner decorations */
.csm-corner {
  position: absolute;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(0,255,255,0.2);
  z-index: 5;
}
.csm-tl { top: 20px; left: 20px; border-right: none; border-bottom: none; }
.csm-tr { top: 20px; right: 20px; border-left: none; border-bottom: none; }
.csm-bl { bottom: 20px; left: 20px; border-right: none; border-top: none; }
.csm-br { bottom: 20px; right: 20px; border-left: none; border-top: none; }

/* Main container */
.csm-main-container {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Header */
.csm-header {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 20;
}
.csm-header h1 {
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 8px;
  background: linear-gradient(90deg, var(--csm-cyan), var(--csm-magenta), var(--csm-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(0,255,255,0.5);
  animation: csm-titlePulse 3s ease-in-out infinite;
  transition: text-shadow 0.1s;
}
.csm-subtitle {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: var(--csm-green);
  letter-spacing: 4px;
  margin-top: 10px;
  opacity: 0.8;
}

@keyframes csm-titlePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

/* Character */
.csm-character-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 15;
}
.csm-hacker-svg {
  width: 400px;
  height: 500px;
  filter: drop-shadow(0 0 20px rgba(0,255,65,0.3));
  animation: csm-characterFloat 4s ease-in-out infinite;
}

@keyframes csm-characterFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

.csm-tablet-glow { animation: csm-tabletPulse 2s ease-in-out infinite; }
@keyframes csm-tabletPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.csm-eye-glow { animation: csm-eyePulse 3s ease-in-out infinite; }
@keyframes csm-eyePulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.csm-code-text {
  font-family: 'Share Tech Mono', monospace;
  font-size: 8px;
  fill: var(--csm-green);
  animation: csm-codeFlicker 0.1s infinite;
}
@keyframes csm-codeFlicker {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Right Side Menu */
.csm-right-menu {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 25px;
  z-index: 20;
}

.csm-menu-item {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.csm-hexagon {
  width: 70px;
  height: 80px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.csm-hexagon-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--csm-cyan);
  stroke-width: 2;
  filter: drop-shadow(0 0 10px var(--csm-cyan));
  transition: all 0.2s ease;
}

.csm-hexagon:hover .csm-hexagon-bg {
  stroke: var(--csm-magenta);
  filter: drop-shadow(0 0 20px var(--csm-magenta));
  transform: scale(1.15) translateX(-8px);
}

.csm-hexagon-icon {
  position: relative;
  z-index: 2;
  font-size: 28px;
  transition: all 0.2s ease;
}

.csm-hexagon:hover .csm-hexagon-icon {
  transform: scale(1.15) translateX(-8px);
}

.csm-menu-item:hover {
  animation: csm-glitch 0.3s ease;
}

@keyframes csm-glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

/* Tooltip */
.csm-tooltip {
  position: absolute;
  right: 90px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10,10,10,0.95);
  border: 1px solid var(--csm-cyan);
  padding: 12px 18px;
  border-radius: 4px;
  min-width: 220px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}
.csm-tooltip::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 8px 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent transparent var(--csm-cyan);
}
.csm-menu-item:hover .csm-tooltip {
  opacity: 1;
  visibility: visible;
  right: 100px;
}
.csm-tooltip-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--csm-cyan);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.csm-tooltip-desc {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  color: #aaa;
  line-height: 1.4;
}

/* Level colors */
.csm-level-1:hover .csm-hexagon-bg { stroke: var(--csm-green); filter: drop-shadow(0 0 20px var(--csm-green)); }
.csm-level-1:hover .csm-hexagon-icon { color: var(--csm-green); }
.csm-level-1 .csm-tooltip { border-color: var(--csm-green); }
.csm-level-1 .csm-tooltip::after { border-left-color: var(--csm-green); }
.csm-level-1 .csm-tooltip-title { color: var(--csm-green); }

.csm-level-2:hover .csm-hexagon-bg { stroke: var(--csm-orange); filter: drop-shadow(0 0 20px var(--csm-orange)); }
.csm-level-2:hover .csm-hexagon-icon { color: var(--csm-orange); }
.csm-level-2 .csm-tooltip { border-color: var(--csm-orange); }
.csm-level-2 .csm-tooltip::after { border-left-color: var(--csm-orange); }
.csm-level-2 .csm-tooltip-title { color: var(--csm-orange); }

.csm-level-3:hover .csm-hexagon-bg { stroke: var(--csm-magenta); filter: drop-shadow(0 0 20px var(--csm-magenta)); }
.csm-level-3:hover .csm-hexagon-icon { color: var(--csm-magenta); }
.csm-level-3 .csm-tooltip { border-color: var(--csm-magenta); }
.csm-level-3 .csm-tooltip::after { border-left-color: var(--csm-magenta); }
.csm-level-3 .csm-tooltip-title { color: var(--csm-magenta); }

.csm-level-4:hover .csm-hexagon-bg { stroke: var(--csm-cyan); filter: drop-shadow(0 0 20px var(--csm-cyan)); }
.csm-level-4:hover .csm-hexagon-icon { color: var(--csm-cyan); }
.csm-level-4 .csm-tooltip { border-color: var(--csm-cyan); }
.csm-level-4 .csm-tooltip::after { border-left-color: var(--csm-cyan); }
.csm-level-4 .csm-tooltip-title { color: var(--csm-cyan); }

@keyframes csm-rainbow-stroke {
  0%   { stroke: #00FF41; filter: drop-shadow(0 0 20px #00FF41); }
  25%  { stroke: #00FFFF; filter: drop-shadow(0 0 20px #00FFFF); }
  50%  { stroke: #FF00FF; filter: drop-shadow(0 0 20px #FF00FF); }
  75%  { stroke: #FF6600; filter: drop-shadow(0 0 20px #FF6600); }
  100% { stroke: #00FF41; filter: drop-shadow(0 0 20px #00FF41); }
}
@keyframes csm-rainbow-color {
  0%   { color: #00FF41; }
  25%  { color: #00FFFF; }
  50%  { color: #FF00FF; }
  75%  { color: #FF6600; }
  100% { color: #00FF41; }
}
@keyframes csm-rainbow-border {
  0%   { border-color: #00FF41; }
  25%  { border-color: #00FFFF; }
  50%  { border-color: #FF00FF; }
  75%  { border-color: #FF6600; }
  100% { border-color: #00FF41; }
}

.csm-deepfake .csm-hexagon-bg {
  animation: csm-rainbow-stroke 3s linear infinite;
}
.csm-deepfake .csm-hexagon-icon {
  animation: csm-rainbow-color 3s linear infinite;
}
.csm-deepfake:hover .csm-hexagon-bg { animation-duration: 1s; }
.csm-deepfake:hover .csm-hexagon-icon { animation-duration: 1s; }
.csm-deepfake .csm-tooltip {
  animation: csm-rainbow-border 3s linear infinite;
}
.csm-deepfake .csm-tooltip::after { border-left-color: #FF00FF; }
.csm-deepfake .csm-tooltip-title {
  animation: csm-rainbow-color 3s linear infinite;
}

.csm-level-5:hover .csm-hexagon-bg { stroke: #a855f7; filter: drop-shadow(0 0 20px #a855f7); }
.csm-level-5:hover .csm-hexagon-icon { color: #a855f7; }
.csm-level-5 .csm-tooltip { border-color: #a855f7; }
.csm-level-5 .csm-tooltip::after { border-left-color: #a855f7; }
.csm-level-5 .csm-tooltip-title { color: #a855f7; }

/* Bottom Container */
.csm-bottom-container {
  position: absolute;
  bottom: 50px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 140px;
  z-index: 20;
}

.csm-bottom-block {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.csm-block-shape {
  width: 120px;
  height: 60px;
  background: rgba(10,10,10,0.9);
  border: 2px solid var(--csm-cyan);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  position: relative;
  transition: all 0.2s ease;
}
.csm-block-shape::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 10px;
  border: 1px solid var(--csm-cyan);
  opacity: 0;
  transition: all 0.2s ease;
}
.csm-bottom-block:hover .csm-block-shape {
  border-color: var(--csm-magenta);
  box-shadow: 0 0 30px rgba(255,0,255,0.5);
  transform: scale(1.05);
}
.csm-bottom-block:hover .csm-block-shape::before {
  opacity: 1;
  border-color: var(--csm-magenta);
  animation: csm-pulseRing 1.5s ease-out infinite;
}
@keyframes csm-pulseRing {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}
.csm-block-icon {
  font-size: 24px;
  color: var(--csm-cyan);
  transition: all 0.2s ease;
}
.csm-bottom-block:hover .csm-block-icon { color: var(--csm-magenta); }
.csm-block-text {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: white;
}

.csm-block-tooltip {
  position: absolute;
  bottom: 75px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,10,0.95);
  border: 1px solid var(--csm-cyan);
  padding: 10px 15px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  color: #aaa;
}
.csm-block-tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: var(--csm-cyan) transparent transparent;
}
.csm-bottom-block:hover .csm-block-tooltip {
  opacity: 1;
  visibility: visible;
  bottom: 85px;
  border-color: var(--csm-magenta);
}
.csm-bottom-block:hover .csm-block-tooltip::after {
  border-top-color: var(--csm-magenta);
}

/* Progress bar */
.csm-progress-bar {
  margin-top: 12px;
}
.csm-progress-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #555;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.csm-progress-count {
  color: var(--csm-green);
}
.csm-progress-track {
  width: 220px;
  height: 3px;
  background: rgba(0,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}
.csm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--csm-green), var(--csm-cyan));
  border-radius: 2px;
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(0,255,65,0.6);
}

/* Done badge on hexagon */
.csm-done-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--csm-green);
  color: #000;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 0 8px rgba(0,255,65,0.8);
  font-family: 'Orbitron', monospace;
}

/* Done state dims the hexagon border to green */
.csm-done .csm-hexagon-bg {
  stroke: var(--csm-green);
  filter: drop-shadow(0 0 6px rgba(0,255,65,0.4));
}

/* Done badge on wiki/quiz blocks */
.csm-block-done {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--csm-green);
  color: #000;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(0,255,65,0.8);
  font-family: 'Orbitron', monospace;
}

/* Ironic ticker */
.csm-ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: rgba(0,0,0,0.9);
  border-top: 1px solid rgba(255,0,64,0.3);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 20;
}
.csm-ticker-label {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  color: #FF0040;
  letter-spacing: 1px;
  padding: 0 12px;
  white-space: nowrap;
  border-right: 1px solid rgba(255,0,64,0.3);
  flex-shrink: 0;
}
.csm-ticker-track {
  flex: 1;
  overflow: hidden;
  padding: 0 16px;
  display: flex;
  align-items: center;
}
.csm-ticker-msg {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: #aaa;
  white-space: nowrap;
  animation: csm-ticker-fade 0.4s ease;
}
@keyframes csm-ticker-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Notification */
.csm-notification {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,10,0.95);
  border: 2px solid var(--csm-green);
  padding: 20px 40px;
  border-radius: 4px;
  z-index: 10000;
  text-align: center;
  box-shadow: 0 0 30px rgba(0,255,65,0.5);
  animation: csm-notifIn 0.3s ease;
}
.csm-notification.csm-notif-out {
  animation: csm-notifOut 0.3s ease forwards;
}
.csm-notif-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--csm-green);
  margin-bottom: 8px;
  letter-spacing: 2px;
}
.csm-notif-message {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  color: #aaa;
}
@keyframes csm-notifIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes csm-notifOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Responsive */
@media (max-width: 1024px) {
  .csm-hacker-svg { width: 300px; height: 375px; }
  .csm-right-menu { right: 20px; gap: 15px; }
  .csm-hexagon { width: 55px; height: 63px; }
  .csm-hexagon-icon { font-size: 22px; }
  .csm-tooltip { min-width: 180px; padding: 10px 14px; }
  .csm-header h1 { font-size: 1.8rem; }
}
@media (max-width: 768px) {
  .csm-header h1 { font-size: 1.4rem; letter-spacing: 4px; }
  .csm-hacker-svg { width: 220px; height: 275px; }
  .csm-right-menu { right: 10px; gap: 10px; }
  .csm-hexagon { width: 45px; height: 52px; }
  .csm-hexagon-icon { font-size: 18px; }
  .csm-tooltip { display: none; }
  .csm-bottom-container { padding: 0 30px; bottom: 30px; }
  .csm-block-shape { width: 90px; height: 50px; }
  .csm-block-text { font-size: 0.7rem; }
}
