/* =====================================================
   HAKENHALTER CSS - OP SIMULATOR
   ===================================================== */

.game-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.game-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

/* Screen Shake Effect */
.shake-screen {
  animation: cameraShake 0.4s ease infinite;
}

@keyframes cameraShake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(0px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(2px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* --- Start Screen --- */
.or-start {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  animation: fadeIn 0.5s ease;
}

.or-start h2 {
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--teal), var(--cyan), var(--violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.or-start p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Level Grid */
.op-levels-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}

@media (max-width: 820px) {
  .op-levels-grid {
    grid-template-columns: 1fr;
  }
}

.op-level-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition);
}

.op-level-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  background: rgba(255, 255, 255, 0.04);
}

.op-level-badge {
  align-self: flex-start;
}

.op-level-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.op-level-doc {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal);
  margin: 0;
}

.op-level-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.op-level-card .btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
}

/* Rules Grid */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .rules-grid {
    grid-template-columns: 1fr;
  }
}

.rule-card {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rule-card h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.rule-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

/* --- Active Layout (Split Panels) --- */
.or-game-layout {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: start;
  animation: fadeIn 0.4s ease;
}

@media (max-width: 860px) {
  .or-game-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Left Panel: Surgical Field */
.or-field-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.canvas-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, #101524 0%, #080a12 100%);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  cursor: none; /* Hide standard cursor */
}

#op-canvas {
  width: 100%;
  height: 440px;
  display: block;
}

/* Center Crosshair Indicator */
.target-guide {
  position: absolute;
  top: 15px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.target-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-ekg);
}

.target-dot.drifting {
  background: var(--orange);
  animation: flash 1s infinite alternate;
}

/* Right Panel: Surgeon & Action Controls */
.or-control-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Surgeon Card */
.surgeon-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
}

.surgeon-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.surgeon-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(0, 210, 210, 0.15);
}

.surgeon-status-light {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green-ekg);
  border: 2px solid #0d1526;
  box-shadow: 0 0 8px var(--green-ekg);
}

.surgeon-status-light.angry {
  background: var(--rose);
  box-shadow: 0 0 8px var(--rose);
  animation: flash 0.5s infinite alternate;
}

.surgeon-info {
  line-height: 1.35;
}

.surgeon-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

.surgeon-title {
  font-size: 0.76rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Speech Bubble */
.speech-bubble {
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.55;
  font-style: italic;
  min-height: 96px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-card);
}

.speech-bubble::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 36px;
  border-width: 0 10px 12px 10px;
  border-style: solid;
  border-color: transparent transparent var(--border-subtle) transparent;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 37px;
  border-width: 0 9px 11px 9px;
  border-style: solid;
  border-color: transparent transparent #0d1526 transparent;
}

/* EKG Monitor & Stat Card combined */
.monitor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.monitor-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
}

.monitor-stat__val {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
}

.monitor-stat__lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.ekg-monitor-panel {
  grid-column: span 2;
  height: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #020617;
  overflow: hidden;
  position: relative;
}

#ekg-monitor-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Action Controls Panel */
.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.action-card h3 {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.op-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  outline: none;
}

.op-action-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-accent);
}

.op-action-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.op-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.op-action-btn .btn-icon {
  font-size: 1.5rem;
}

.op-action-btn .btn-text {
  font-size: 0.88rem;
  font-weight: 700;
}

.op-action-btn .btn-hotkey {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Sweat Blur Overlay --- */
.sweat-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: transparent;
  transition: backdrop-filter 0.4s ease, background-color 0.4s ease;
  backdrop-filter: blur(0px);
}

.sweat-overlay.active {
  backdrop-filter: blur(8px) saturate(80%);
  background-color: rgba(251, 146, 60, 0.04);
}

/* Summary Box in Modal */
.or-summary-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-top: 1.25rem;
  text-align: left;
}

/* Animations */
@keyframes flash {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}
