@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Noto+Sans+JP:wght@400;500;700&display=swap');

* { box-sizing: border-box; }
body { font-family: 'Noto Sans JP', sans-serif; background: #0f172a; color: #e2e8f0; }
.font-orbitron { font-family: 'Orbitron', sans-serif; }

.screen { display: none; opacity: 0; transition: opacity 0.4s ease; }
.screen.active { display: block; opacity: 1; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(6,182,212,0.3); }
  50% { box-shadow: 0 0 20px rgba(6,182,212,0.8); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes score-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); color: #22c55e; }
  100% { transform: scale(1); }
}
@keyframes ripple {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

.animate-float { animation: float 3s ease-in-out infinite; }
.animate-shake { animation: shake 0.4s ease; }
.animate-slide-up { animation: slide-up 0.5s ease forwards; }
.animate-glow { animation: pulse-glow 2s ease-in-out infinite; }
.animate-score { animation: score-pop 0.5s ease; }

.bit-cell {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #334155;
  border-radius: 4px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.bit-cell.network { background: rgba(6,182,212,0.25); border-color: #06b6d4; color: #06b6d4; }
.bit-cell.host-bit { background: rgba(245,158,11,0.15); border-color: #f59e0b; color: #f59e0b; }

.slider-custom { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 4px; outline: none; }
.slider-custom::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: #06b6d4; cursor: pointer;
  box-shadow: 0 0 10px rgba(6,182,212,0.5);
}
.slider-custom::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; border: none;
  background: #06b6d4; cursor: pointer;
}

.device-icon {
  width: 70px; height: 70px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 12px; cursor: pointer;
  transition: all 0.3s ease;
  font-size: 28px;
}
.device-icon:hover { transform: scale(1.1); }
.device-icon.same-net { box-shadow: 0 0 15px rgba(6,182,212,0.6); border: 2px solid #06b6d4; }
.device-icon.diff-net { box-shadow: 0 0 15px rgba(239,68,68,0.4); border: 2px solid #ef4444; }

.quiz-option {
  transition: all 0.2s ease;
  cursor: pointer;
}
.quiz-option:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(6,182,212,0.3); }
.quiz-option.correct { background: rgba(34,197,94,0.2) !important; border-color: #22c55e !important; }
.quiz-option.wrong { background: rgba(239,68,68,0.2) !important; border-color: #ef4444 !important; }

/* Progress is now shown as bottom border on nav-menu-items */
.nav-menu-item {
  border-bottom: 3px solid transparent;
}
.nav-menu-item.visited {
  border-bottom-color: #06b6d4;
}

.tooltip-content {
  visibility: hidden; opacity: 0;
  transition: all 0.2s ease;
  position: absolute; z-index: 50;
}
.tooltip-trigger:hover .tooltip-content {
  visibility: visible; opacity: 1;
}

.tab-btn { transition: all 0.2s ease; }
.tab-btn.active { background: rgba(6,182,212,0.2); border-color: #06b6d4; color: #06b6d4; }

/* Smart IP Input */
.ip-input-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 2px 4px;
  transition: border-color 0.2s;
}
.ip-input-group:focus-within {
  border-color: #06b6d4;
  box-shadow: 0 0 0 2px rgba(6,182,212,0.15);
}
.ip-octet-input {
  width: 48px;
  background: transparent;
  border: none;
  text-align: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  color: #06b6d4;
  outline: none;
  padding: 6px 2px;
  -moz-appearance: textfield;
}
.ip-octet-input::-webkit-inner-spin-button,
.ip-octet-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ip-octet-input:focus {
  background: rgba(6,182,212,0.08);
  border-radius: 4px;
}
.ip-dot {
  color: #475569;
  font-weight: bold;
  font-size: 16px;
  user-select: none;
}

/* Nav menu */
.nav-menu-item {
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-menu-item:hover {
  background: rgba(6,182,212,0.1);
  color: #06b6d4;
}
.nav-menu-item.active {
  background: rgba(6,182,212,0.15);
  color: #06b6d4;
  font-weight: 600;
}
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0 0 12px 12px;
  padding: 12px;
  display: none;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.nav-dropdown.show {
  display: block;
}

/* Scenario card grid */
.scenario-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #0f172a;
  cursor: pointer;
  transition: all 0.2s ease;
}
.scenario-card:hover {
  border-color: #06b6d4;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6,182,212,0.15);
}
.scenario-card.completed {
  border-color: #22c55e;
  background: rgba(34,197,94,0.05);
}

/* Tip modal */
.tip-amount-btn {
  border-color: #334155;
  background: #0f172a;
  color: #94a3b8;
}
.tip-amount-btn:hover {
  border-color: #64748b;
  color: #e2e8f0;
}
.tip-amount-btn.active {
  border-color: #db2777;
  background: rgba(219, 39, 119, 0.1);
  color: #f9a8d4;
}
.tip-nav-btn {
  animation: pulse-glow-pink 3s ease-in-out infinite;
}
@keyframes pulse-glow-pink {
  0%, 100% { box-shadow: 0 0 4px rgba(219,39,119,0.2); }
  50% { box-shadow: 0 0 12px rgba(219,39,119,0.4); }
}

/* Mobile menu */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: #1e293b; border-bottom: 1px solid #334155; padding: 8px; }
  .ip-octet-input { width: 40px; font-size: 12px; }
}
