*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --win-bg: #c0c0c0;
  --win-dark: #808080;
  --win-darker: #404040;
  --win-light: #dfdfdf;
  --win-white: #ffffff;
  --win-title: #000080;
  --win-title-text: #ffffff;
  --teal-bg: #008080;
  --terminal-bg: #0a0a0a;
  --terminal-text: #33ff33;
  --crt-glow: rgba(0, 255, 100, 0.05);
}

body {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--teal-bg);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.03) 2px,
      rgba(0,0,0,0.03) 4px
    );
  color: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

#app {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Windows 95 beveled styles */
.win95-window {
  background: var(--win-bg);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-dark);
}

.win95-inset {
  background: var(--win-bg);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  box-shadow: inset 1px 1px 0 var(--win-darker), inset -1px -1px 0 var(--win-light);
}

.win95-button {
  background: var(--win-bg);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  box-shadow: inset 1px 1px 0 var(--win-light), inset -1px -1px 0 var(--win-dark);
  padding: 4px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  cursor: pointer;
}
.win95-button:active {
  border-top: 2px solid var(--win-darker);
  border-left: 2px solid var(--win-darker);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  box-shadow: inset 1px 1px 0 var(--win-dark);
}

/* Title Bar */
#title-bar {
  position: relative;
  overflow: hidden;
}
.title-bar-inner {
  padding: 6px 8px;
  position: relative;
  z-index: 2;
}
.title-bar-top {
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, var(--win-title), #1084d0);
  padding: 3px 6px;
  margin: -2px -4px 6px;
}
.title-icon {
  font-size: 16px;
  margin-right: 6px;
}
.title-text {
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: var(--win-title-text);
  flex: 1;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  letter-spacing: 2px;
}
.tagline {
  font-size: 11px;
  color: #333;
  text-align: center;
  font-style: italic;
}

.window-buttons {
  display: flex;
  gap: 2px;
}
.win-btn {
  width: 20px;
  height: 20px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  font-size: 12px;
  line-height: 1;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
}

.scanlines {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0,0,0,0.05) 1px,
    rgba(0,0,0,0.05) 2px
  );
  pointer-events: none;
  z-index: 1;
}

/* Drop Zone CRT */
#drop-zone {
  position: relative;
  cursor: pointer;
  border-radius: 20px;
  padding: 50px 20px;
  margin: 8px 0;
  background: #111;
  border: 8px solid #333;
  box-shadow:
    inset 0 0 60px rgba(0,255,100,0.05),
    0 0 20px rgba(0,0,0,0.5),
    inset 0 0 100px rgba(0,0,0,0.8);
  text-align: center;
  transition: all 0.3s;
}
#drop-zone:hover, #drop-zone.drag-over {
  box-shadow:
    inset 0 0 60px rgba(0,255,100,0.15),
    0 0 30px rgba(0,255,100,0.2),
    inset 0 0 100px rgba(0,0,0,0.6);
}
.crt-glow {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, rgba(0,255,100,0.03) 0%, transparent 70%);
  pointer-events: none;
}
.drop-content {
  position: relative;
  z-index: 2;
}
.drop-icon {
  font-size: 64px;
  animation: pulse 2s ease-in-out infinite;
}
.drop-text {
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: var(--terminal-text);
  margin: 12px 0 4px;
  text-shadow: 0 0 10px rgba(51,255,51,0.5);
}
.drop-subtext {
  font-size: 12px;
  color: #666;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* Player */
#player-section {
  padding: 0;
}
.player-title-bar {
  background: linear-gradient(90deg, var(--win-title), #1084d0);
  color: var(--win-title-text);
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 700;
}
#canvas-wrapper {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 3px solid;
  border-color: var(--win-dark) var(--win-white) var(--win-white) var(--win-dark);
  margin: 4px;
}
#video-canvas {
  display: block;
  max-width: 100%;
  image-rendering: pixelated;
}

/* Controls */
#controls {
  padding: 6px 8px;
  margin: 0 4px 4px;
}
.controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
}
.ctrl-btn {
  width: 36px;
  height: 30px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctrl-btn.big {
  width: 48px;
  height: 34px;
  font-size: 18px;
}
.ctrl-btn:active {
  border-top: 2px solid var(--win-darker);
  border-left: 2px solid var(--win-darker);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
}

.seek-slider {
  width: 100%;
  height: 18px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--win-bg);
  border: 2px solid;
  border-color: var(--win-dark) var(--win-white) var(--win-white) var(--win-dark);
  outline: none;
}
.seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 20px;
  background: var(--win-bg);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
  cursor: pointer;
}

.info-row {
  justify-content: space-between;
  font-size: 11px;
  color: #333;
}

.win95-select {
  background: var(--win-white);
  border: 2px solid;
  border-color: var(--win-dark) var(--win-white) var(--win-white) var(--win-dark);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 1px 4px;
}

/* Panels */
.panel-title-bar {
  background: var(--win-bg);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--win-dark);
  user-select: none;
}
.toggle-arrow {
  font-size: 10px;
}
.panel-content {
  padding: 8px;
}
.panel-content.collapsed {
  display: none;
}

.props-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}
.props-table td {
  padding: 2px 6px;
  border-bottom: 1px solid var(--win-light);
}
.props-table td:first-child {
  font-weight: 700;
  color: #333;
  width: 40%;
}

/* Terminal */
.terminal {
  background: var(--terminal-bg);
  color: var(--terminal-text);
  font-family: 'VT323', monospace;
  font-size: 14px;
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.4;
}
.terminal.collapsed {
  display: none;
}
#log-output .log-line {
  margin-bottom: 1px;
}
.log-line.error {
  color: #ff4444;
}
.log-line.success {
  color: #44ff44;
}
.log-line.info {
  color: #aaaaaa;
}
.log-line.warn {
  color: #ffaa00;
}

/* Status Bar */
.win95-statusbar {
  background: var(--win-bg);
  border-top: 2px solid var(--win-dark);
  border-left: 2px solid var(--win-dark);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  padding: 2px 8px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}

/* Footer */
#footer {
  text-align: center;
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  padding: 10px;
}
#footer a {
  color: rgba(255,255,255,0.8);
  text-decoration: underline;
  margin-left: 8px;
}

/* Clippy Modal */
#clippy-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.clippy-box {
  width: 340px;
  padding: 0;
}
.clippy-title-bar {
  background: linear-gradient(90deg, var(--win-title), #1084d0);
  color: white;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.clippy-content {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  gap: 12px;
}
.clippy-char {
  font-size: 48px;
  animation: clippy-bounce 1s ease-in-out infinite;
}
@keyframes clippy-bounce {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
.clippy-text {
  font-size: 13px;
  line-height: 1.5;
}
.clippy-actions {
  padding: 8px 16px 12px;
  text-align: center;
}

/* Scrollbar styling for terminal */
.terminal::-webkit-scrollbar {
  width: 16px;
}
.terminal::-webkit-scrollbar-track {
  background: var(--win-bg);
  border: 1px solid var(--win-dark);
}
.terminal::-webkit-scrollbar-thumb {
  background: var(--win-bg);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-darker);
  border-bottom: 2px solid var(--win-darker);
}

@media (max-width: 600px) {
  .title-text { font-size: 22px; }
  .drop-text { font-size: 20px; }
  .drop-icon { font-size: 40px; }
  #drop-zone { padding: 30px 10px; }
}