@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap');

body, html {
  margin: 0;
  padding: 0;
  font-family: 'Comic Neue', cursive;
  height: 100%;
  overflow-x: hidden;
}

.scroll-container {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  perspective: 1px;
  overflow-x: hidden;
}

.scroll-content {
  position: relative;
  transform-style: preserve-3d;
  padding-bottom: 50px;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
  0% {background-position: 0% 50%;}
  50% {background-position: 100% 50%;}
  100% {background-position: 0% 50%;}
}

.container {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 500px;
  text-align: center;
  position: relative;
  border: 5px solid #000;
  transform: rotate(-2deg);
  overflow: hidden;
  margin: 20px auto;
}

.container::before {
  content: "BRAINROT ZONE ";
  position: absolute;
  top: -20px;
  left: -20px;
  background-color: #ff6b6b;
  color: white;
  padding: 5px 20px;
  transform: rotate(-45deg);
  font-weight: bold;
}

h1 {
  font-size: 2.5rem;
  color: #ff6b6b;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 20px;
}

textarea {
  width: 100%;
  height: 150px;
  margin-bottom: 15px;
  padding: 10px;
  border: 3px dashed #4ecdc4;
  border-radius: 10px;
  resize: none;
  font-family: 'Comic Neue', cursive;
  background-color: #f0f0f0;
}

.intensity-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.intensity-container label {
  margin-bottom: 10px;
  color: #ff6b6b;
  font-weight: bold;
}

#brainrotIntensity {
  width: 100%;
  accent-color: #ff6b6b;
}

.mode-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.mode-container label {
  margin-bottom: 10px;
  color: #ff6b6b;
  font-weight: bold;
}

#translationMode {
  width: 100%;
  padding: 10px;
  border: 3px dashed #4ecdc4;
  border-radius: 10px;
  background-color: #f0f0f0;
  font-family: 'Comic Neue', cursive;
}

.mode-descriptions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 15px;
  margin-top: 20px;
}

.mode-description {
  background-color: rgba(255, 255, 255, 0.9);
  border: 3px dashed #ff6b6b;
  border-radius: 10px;
  padding: 15px;
  width: calc(33.333% - 20px);
  box-sizing: border-box;
  text-align: center;
  transition: transform 0.3s ease;
}

.mode-description:hover {
  transform: scale(1.05);
  background-color: #fff3f3;
}

.mode-description h3 {
  color: #ff6b6b;
  margin-bottom: 10px;
}

.mode-description p {
  font-size: 0.9rem;
  color: #333;
}

@media (max-width: 768px) {
  .mode-description {
    width: 100%;
  }
}

button {
  background-color: #ff6b6b;
  color: white;
  border: 3px solid #000;
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Comic Neue', cursive;
  font-weight: bold;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 #000;
}

button:hover {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 #000;
  background-color: #4ecdc4;
}

.output {
  margin-top: 15px;
  padding: 10px;
  border: 3px dotted #ff6b6b;
  border-radius: 10px;
  min-height: 50px;
  max-height: 200px;
  overflow-y: auto;
  background-color: #f9f9f9;
  font-style: italic;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.4;
}

.output::before {
  content: "";
  display: block;
  color: #ff6b6b;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.additional-content {
  background-color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
  margin: 30px auto;
  padding: 20px;
  border-radius: 15px;
  text-align: center;
}

.meme-zone {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
}

.meme-card {
  background-color: #ff6b6b;
  color: white;
  padding: 15px;
  border-radius: 10px;
  width: 40%;
  box-shadow: 3px 3px 0 #000;
  border: 3px solid #000;
  transform: rotate(3deg);
  transition: transform 0.3s;
}

.meme-card:hover {
  transform: rotate(0deg) scale(1.05);
}

.warning-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  box-sizing: border-box;
}

.warning-content {
  background-color: rgba(255, 255, 255, 0.9);
  border: 5px solid #000;
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.warning-content h2 {
  color: #ff6b6b;
  margin-bottom: 20px;
}

.warning-content p {
  margin-bottom: 20px;
  line-height: 1.6;
}

.warning-content button {
  background-color: #ff6b6b;
  color: white;
  border: 3px solid #000;
  padding: 10px 20px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Comic Neue', cursive;
  font-weight: bold;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 #000;
}

.warning-content button:hover {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 #000;
  background-color: #4ecdc4;
}

.mode-info-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.7);
  padding: 20px;
  box-sizing: border-box;
}

.mode-info-content {
  background-color: rgba(255, 255, 255, 0.95);
  margin: 5% auto;
  padding: 30px;
  border-radius: 20px;
  max-width: 800px;
  position: relative;
  border: 5px solid #ff6b6b;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-height: 80vh;
  overflow-y: auto;
}

.close-modal {
  color: #ff6b6b;
  float: right;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
}

.mode-info-sections {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.mode-info-section {
  width: 48%;
  margin-bottom: 20px;
  background-color: #f9f9f9;
  border-radius: 10px;
  padding: 15px;
  border: 3px dashed #4ecdc4;
}

.mode-info-section h3 {
  color: #ff6b6b;
  border-bottom: 2px solid #ff6b6b;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.mode-info-section ul {
  list-style-type: none;
  padding: 0;
}

.mode-info-section ul li {
  margin-bottom: 10px;
  line-height: 1.4;
}

.mode-info-section ul li strong {
  color: #4ecdc4;
}

.info-btn {
  background-color: #4ecdc4;
  color: white;
  border: 3px solid #000;
  padding: 5px 10px;
  border-radius: 10px;
  margin-left: 10px;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.info-btn:hover {
  background-color: #ff6b6b;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .mode-description {
    width: 100%;
  }
  .mode-info-section {
    width: 100%;
  }
}

.mode-info-section:last-child {
  width: 100%;
}

.swear-toggle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 15px 0;
}

.swear-toggle-label {
  display: flex;
  align-items: center;
  font-weight: bold;
  color: #ff6b6b;
  cursor: pointer;
  position: relative;
  padding-left: 50px;
}

.swear-toggle-label input {
  opacity: 0;
  width: 0;
  height: 0;
}

.swear-toggle-slider {
  position: absolute;
  left: 0;
  width: 40px;
  height: 20px;
  background-color: #ddd;
  border-radius: 20px;
  transition: 0.4s;
}

.swear-toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

.swear-toggle-label input:checked + .swear-toggle-slider {
  background-color: #ff6b6b;
}

.swear-toggle-label input:checked + .swear-toggle-slider::before {
  transform: translateX(20px);
}

body::after {
  content: "sus ";
  position: fixed;
  bottom: 10px;
  right: 10px;
  font-size: 1.5rem;
  opacity: 0.5;
  transform: rotate(-10deg);
}

/* Customization Options Styles */
.customization-options {
  background-color: rgba(255, 255, 255, 0.9);
  border: 3px dashed #4ecdc4;
  border-radius: 10px;
  padding: 15px;
  margin: 10px auto;
  max-width: 500px;
  text-align: left;
}
.customization-options label {
  display: block;
  margin-top: 10px;
  color: #ff6b6b;
  font-weight: bold;
}
.customization-options select,
.customization-options input[type="range"] {
  width: 100%;
  margin-bottom: 10px;
}

/* ============================================================
   Mobile redesign (desktop untouched — all in a max-width:768px
   query): fixed viewport, NO scroll; the card fills the screen as a
   grid (input + output flex to fill); the two action buttons sit in
   one row; "what are these modes?" opens a right-side panel; the
   scroll-down mode descriptions are hidden (redundant with the dropdown).
   ============================================================ */
@media (max-width: 768px) {
  html, body { height: 100dvh; overflow: hidden; }

  /* No page scroll; a thin gradient frame around the card */
  .scroll-container { height: 100dvh; overflow: hidden; perspective: none; }
  .scroll-content {
    height: 100dvh; min-height: 0; padding: 6px; box-sizing: border-box;
    display: flex; transform-style: flat;
  }

  /* Redundant with the mode dropdown — hide the long descriptions below */
  .additional-content, .mode-descriptions { display: none !important; }

  /* The corner "BRAINROT ZONE" banner overlapped the title on the full-bleed
     card — hide it on phones (purely decorative). */
  .container::before { display: none; }

  /* Card fills the screen as a grid */
  .container {
    box-sizing: border-box;
    width: 100%; max-width: 100%; height: 100%;
    margin: 0; padding: 10px 12px calc(8px + env(safe-area-inset-bottom));
    transform: none; border-width: 3px; border-radius: 14px; overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "title     title"
      "input     input"
      "intensity intensity"
      "modelbl   modelbl"
      "mode      mode"
      "cust      cust"
      "swear     swear"
      "modeinfo  yeet"
      "output    output";
    grid-template-rows: auto minmax(52px,1fr) auto auto auto auto auto auto minmax(72px,1.4fr);
    gap: 7px;
  }
  .container h1 { grid-area: title; font-size: 1.1rem; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
  #englishInput { grid-area: input; height: 100%; min-height: 0; margin: 0; box-sizing: border-box; }
  .intensity-container { grid-area: intensity; margin: 0; }
  /* display:contents dissolves the mode-container box so its label / select /
     info-button become direct grid items — lets the info button sit beside the
     translate button with NO change to the HTML (so desktop is untouched). */
  .mode-container { display: contents; }
  .mode-container label { grid-area: modelbl; }
  #translationMode { grid-area: mode; }
  #customizationOptions { grid-area: cust; margin: 0; }
  .swear-toggle-container { grid-area: swear; margin: 0; }
  /* Two action buttons share one row, equal height (align-self:stretch default) */
  #modeInfoBtn { grid-area: modeinfo; width: 100%; margin: 0; }
  #translateBtn { grid-area: yeet; width: 100%; margin: 0; }
  #modeInfoBtn, #translateBtn {
    font-size: 0.82rem; padding: 9px 6px; line-height: 1.1;
    display: flex; align-items: center; justify-content: center; text-align: center;
  }
  #brainrotOutput {
    grid-area: output; height: 100%; max-height: none; min-height: 0;
    margin: 0; box-sizing: border-box; overflow-y: auto;
  }

  /* Tighten the slider/label rows */
  .intensity-container label, .mode-container label { margin-bottom: 4px; font-size: 0.95rem; }

  /* Inputs >=16px so iOS doesn't zoom on focus */
  textarea, select, input { font-size: 16px; }

  /* Long text wraps, never overflows */
  .output, #brainrotOutput, .mode-info-section { overflow-wrap: anywhere; }

  /* "What are these modes?" -> right-side slide-in panel (tap scrim / x to close) */
  .mode-info-content {
    box-sizing: border-box;
    position: absolute; top: 0; right: 0; bottom: 0; left: auto;
    margin: 0; width: 90%; max-width: 420px; height: 100%; max-height: 100%;
    border-radius: 16px 0 0 16px; border-width: 0 0 0 5px; padding: 14px 16px;
  }
  /* Keep the close button reachable while the panel scrolls; big tap target */
  .close-modal {
    position: sticky; top: 0; float: right;
    font-size: 40px; line-height: 0.8; padding: 2px 6px; margin: -2px -6px 0 0;
    z-index: 3;
  }

  .customization-options { box-sizing: border-box; max-width: 100%; }
  .warning-content { box-sizing: border-box; max-width: 100%; }
}