:root {
  --primary: #2F3E46;
  --accent: #de9d7f;
  --text-muted: #a0a0a0;
  --warning: #ffcc00;
}

body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #370335 0%, #14000e 100%);
  background-attachment: fixed;
  color: white; margin: 0; display: flex; flex-direction: column; align-items: center;
  min-height: 100vh;
  width: 100%;
}

.browser-notice {
  background: var(--warning); color: #000; width: 100%; padding: 10px;
  text-align: center; font-size: 0.85rem; box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

header { text-align: center; padding: 1.5rem 1rem 0.5rem 1rem; }
header h1 { color: var(--accent); margin: 0; font-size: 1.8rem; }
header .description { margin: 5px 0 0 0; font-size: 0.95rem; opacity: 0.8; }

.upload-section { margin: 0.5rem auto 1rem auto; width: 280px; }
.upload-wrapper { position: relative; height: 50px; }
.upload-button {
  position: absolute; width: 100%; height: 100%;
  background: var(--primary); color: white; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.upload-section input { position: absolute; opacity: 0; width: 100%; height: 100%; z-index: 2; cursor: pointer; }

.instruction-box {
  background: rgba(255, 255, 255, 0.1); padding: 8px; border-radius: 6px;
  margin-bottom: 12px; text-align: center; font-size: 0.85rem; color: var(--accent);
  border: 1px dashed rgba(222, 157, 127, 0.3);
  max-width: 350px;
  line-height: 1.4;
  margin-left: auto;
  margin-right: auto;
}

.main-container { 
    display: flex; 
    gap: 2rem; 
    padding: 1rem; 
    width: 100%; 
    max-width: 1000px; 
    justify-content: center; 
    box-sizing: border-box;
}

.preview-container { 
    background: white; 
    padding: 12px; 
    border-radius: 12px; 
    flex-shrink: 0; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    display: flex;
    flex-direction: column;
    align-items: center;
}

canvas { width: 350px; height: 350px; background: #111; border-radius: 8px; display: block; }

.button-row { display: flex; gap: 8px; margin-top: 12px; width: 100%; }
.action-button {
  background: var(--primary); color: white; border: none; flex: 1;
  padding: 12px; border-radius: 6px; cursor: pointer; font-weight: bold;
}
.secondary { background: #4a5a63 !important; margin-top: 10px; width: 100%; }
.download-highlight { background: #28a745 !important; }

.controls { width: 300px; flex-shrink: 0; }
.pc-slider {
  -webkit-appearance: none; width: 100%; height: 6px; background: #444; border-radius: 5px; outline: none; margin: 12px 0;
}
.pc-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; background: var(--accent); border-radius: 50%; cursor: pointer;
}

.name-settings {
    background: rgba(255, 255, 255, 0.05); padding: 15px; border-radius: 8px;
    margin-top: 10px; border: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    box-sizing: border-box;
}
.name-settings label { display: block; font-size: 0.8rem; margin-bottom: 5px; color: var(--accent); }
#nameInput { 
    width: 75%; 
    padding: 10px; 
    border-radius: 5px; 
    border: none; 
    margin: 0 auto 10px auto;
    display: block;
}

footer {
  margin-top: auto; width: 100%; padding: 2rem 0;
  border-top: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.2);
}
.footer-content { text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.footer-content a { color: var(--accent); text-decoration: none; font-weight: 500; }

@media (max-width: 768px) {
  .main-container { 
      flex-direction: column; 
      align-items: center; 
      padding: 1rem 0; /* Remove side padding to help centering */
  }
  .pc-only { display: none; }
  canvas { width: 90vw; height: 90vw; touch-action: none; }
  .controls { width: 90vw; }
  .instruction-box { max-width: 90vw; }
  .preview-container {
      width: 95vw;
      box-sizing: border-box;
      padding: 10px;
  }
}

@media (min-width: 769px) { .mobile-only { display: none; } }

.hidden { display: none !important; }

.modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.92); z-index: 10000; display: flex; justify-content: center; align-items: center;
}
.modal-content { width: 90%; max-width: 450px; text-align: center; background: #1a1a1a; padding: 20px; border-radius: 15px; }
.modal-content img { width: 100%; border: 3px solid white; margin: 15px 0; border-radius: 10px; }