:root {
  --color-bg-darkest: #0b0d1c;
  --color-bg-dark: #121522;
  --color-bg-mid: #1d2236;
  --color-text-main: #dcd6c0;
  --color-text-soft: #e0cb99;
  --color-gold: #c6aa6b;
  --color-gold-bright: #e0cb99;
  --color-shadow-deep: rgba(0, 0, 0, 0.9);
  --color-shadow-soft: rgba(0, 0, 0, 0.6);
  --color-shadow-subtle: rgba(0, 0, 0, 0.75);
  --color-glow-gold: rgba(198, 170, 107, 0.2);
  --color-glow-title: rgba(150, 150, 180, 0.2);
  --color-input-border: #4b4b4b;
  --color-input-bg: #161b29;

  --mw-bg-dark: #0b0d1c;
  --mw-bg-panel: #121629;
  --mw-gold: #c6aa6b;
  --mw-gold-light: #d8c180;
}

@font-face {
  font-family: 'LeagueFonts';
  src: url('/assets/BeaufortforLOL-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'PixelFonts';
  src: url('/assets/pixel.otf') format('opentype');
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  /* Background stuff */
  background-image: url('https://d2y4hiq4ddyigd.cloudfront.net/bg.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  background-attachment: fixed; /* Optional: keeps image fixed on scroll */
  background-color: var(--color-bg-darkest);
  color: var(--color-text-main);
  font-family: 'PixelFonts', monospace;
}

button, input[type="submit"], input[type="reset"] {
	background: none;
	color: inherit;
	border: none;
	padding: 0;
	font: inherit;
	cursor: pointer;
	outline: inherit;
}


.text-full-screen {
  min-width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-items: center;
  text-align: center;
  border: 3px solid var(--color-gold);
  padding: 20px;
  background: black;
}

.align-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-title,
.player-title {
  text-align: center;
  margin-top: 60px;
  margin-bottom: 40px;
}

.player-name-input-label {
  font-size: 30px;
  letter-spacing: 1px;
  color: #c6aa6b;
  text-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.7),
    0 0 8px rgba(100, 100, 120, 0.2);
  margin-bottom: 10px;
}

.main-title {
  font-size: 48px;
  letter-spacing: 3px;
  color: #e0cb99;
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(198, 170, 107, 0.3),
    0 0 40px rgba(198, 170, 107, 0.1);
  margin-bottom: 10px;
}

.sub-title {
  font-size: 18px;
  letter-spacing: 1px;
  color: #c6aa6b;
  text-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.7),
    0 0 8px rgba(100, 100, 120, 0.2);
}

.memorial-container {
  font-family: 'PixelFonts', serif;
  color: var(--color-gold);
  background: linear-gradient(135deg, var(--color-bg-darkest) 0%, var(--color-bg-dark) 100%);
  border: 0px solid transparent;
  border-image: url('https://d2y4hiq4ddyigd.cloudfront.net/border-2.png') 64 fill stretch;
  padding: 20px;
  max-width: 900px;
  margin: 20px auto;
  border-image-slice: 186 182 182 182;
  border-image-width: 40px;
}

.outer-border {
  position: relative;
  padding: 35px;
  box-shadow:
    inset 0 0 20px var(--color-shadow-soft),
    0 0 30px var(--color-glow-gold);
}

.avatar-frame {
  flex-shrink: 0;
  margin-right: 15px;
}

.avatar-border {
  width: 140px;
  height: 140px;
  border: 3px solid var(--color-gold);
  background: var(--color-bg-darkest);
  position: relative;
  box-shadow:
    inset 0 0 12px var(--color-shadow-deep),
    0 0 18px var(--color-glow-gold);
}

.avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.text-content {
  flex: 1;
  padding-top: 10px;
}

.title {
  font-size: 28px;
  font-weight: bold;
  margin: 0 0 20px 0;
  letter-spacing: 2px;
  color: var(--color-gold-bright);
  text-shadow:
    2px 2px 4px rgba(0, 0, 0, 0.85),
    0 0 8px var(--color-glow-title);
}

.description {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
  color: var(--color-text-main);
  text-shadow: 1px 1px 2px var(--color-shadow-subtle);
}

.name-highlight {
  color: var(--color-gold);
  font-weight: bold;
}

.custom-input {
  border: 2px solid var(--color-input-border);
  background: var(--color-input-bg);
  color: var(--color-gold-bright);
  font-family: 'PixelFonts', monospace;
  letter-spacing: 1px;
  padding: 0.5rem;
  width: 300px;
  box-shadow:
    inset 0 0 6px #000,
    0 0 6px var(--color-glow-gold);
}

.image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.image-grid .media-thumb {
  width: calc(25% - 12px);
  border: 2px solid #c6aa6b;
  background: #0b0d1c;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.media-thumb video, .media-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  cursor: zoom-out;
}

.expanded {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border: 4px solid #c6aa6b;
  background: #121522;
  box-shadow: 0 0 40px rgba(198, 170, 107, 0.3);
  image-rendering: pixelated;
}

.upload-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.upload-box {
  width: 160px;
  height: 160px;
  border: 2px dashed #c6aa6b;
  color: #c6aa6b;
  background: #121522;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'PixelFonts', monospace;
  cursor: pointer;
  image-rendering: pixelated;
  box-shadow: 0 0 10px rgba(198, 170, 107, 0.2);
}

.preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  pointer-events: none;
}

.video-thumb-wrapper {
  position: relative;
}

.play-overlay {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px;
  color: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  user-select: none;
}

.load-more {
  margin: 1rem auto;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  color: #f0f0f0;
  cursor: pointer;
}

.inner-content {
  transition: max-height 0.5s ease, opacity 0.5s ease;
  overflow: hidden;
}

.short-mode {
  max-height: 400px;
  opacity: 1;
}

.long-mode {
  max-height: 1500px; /* or auto, with JS support */
  opacity: 1;
}


@media (max-width: 768px) {
  .memorial-container {
    padding: 10px;
  }

  .outer-border {
    padding: 20px;
  }

  .inner-content {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .avatar-border {
    width: 120px;
    height: 120px;
  }

  .title {
    font-size: 24px;
    text-align: center;
  }

  .description {
    font-size: 16px;
    text-align: center;
  }

  .image-grid img {
    width: calc(50% - 8px);
  }
}

/* ---------- utility ---------- */
.mw-load-more {
  padding: 0.5rem 1.5rem;
  background: var(--mw-gold);
  border: none;
  border-radius: 0.75rem;
  font-weight: 600;
  color: var(--mw-bg-dark);
  cursor: pointer;
  transition: background 150ms;
}
.mw-load-more:hover { background: var(--mw-gold-light); }

.small-text-title {
  font-size: 8px;
}



.x-button {
  right: calc(1rem + 8px);
}

.preserve-newlines {
  white-space: pre-line;
}

.author {
  margin-top: 20px;
}

.p-20 {
  padding: 20px;
}

.margin-b-10 {
  margin-bottom: 10px;
}

/* This is what we will use for rest of our lives*/

/* Layout helper */
.memory-flex-col        { display: flex; flex-direction: column; }
.memory-gap-4           { gap: 1rem; }
.memory-p-4             { padding: 1rem; }
.memory-rounded-2xl     { border-radius: 1rem; }
.memory-rounded-xl      { border-radius: 0.75rem; }
.memory-shadow-lg       { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }


/* Memory Wall */
.memory-grid {
  display: grid;
  gap: 1rem;
  grid-auto-columns: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* generic card wrapper */
.memory-item {
  overflow: hidden;
  width: 100%;
  border: 2px solid #c6aa6b;
  border-radius: 0.75rem;
  background: #0b0d1c;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.memory-item video,
.memory-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* message card */
.text-box-align {
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-items: center;
  text-align: center;
  height: 100%;
}
.text-box-align p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.memory-item.message {
  padding: 1rem;
  background: rgba(18, 22, 41, 0.7);
  border: 2px solid var(--mw-gold);
  border-radius: 0.75rem;
  color: var(--mw-gold);
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.memory-item.message strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}
.memory-item.message p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Composer */
.mw-composer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  background-color: rgba(11, 13, 28, 0.7);
  color: var(--mw-gold);
  margin-bottom: 20px;
  border: 1px solid var(--color-gold);
}

.mw-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  background: var(--mw-bg-panel);
  border: none;
  color: var(--mw-gold);
}

.mw-input::placeholder {
  color: #8c7a4b;
}

.mw-input:focus {
  outline: 2px solid var(--mw-gold-light);
}

.flex-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.preview-box {
  width: 6rem;
  height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 2px solid #d1d5db;
  background-color: #e5e7eb;
  color: #4b5563;
  font-size: 0.875rem;
}

.preview-media {
  width: 6rem;
  height: 6rem;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 2px solid #d1d5db;
}

.mw-attach {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 2px dashed var(--mw-gold);
  border-radius: 0.75rem;
  background: none;
  color: #c6aa6b;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 150ms;
}

.mw-attach:hover {
  background: rgba(198, 170, 107, 0.1);
}

.mw-send {
  align-self: flex-end;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  background: var(--mw-gold);
  color: var(--mw-bg-dark);
  font-weight: bold;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 150ms;
}

.mw-send:hover {
  background: var(--mw-gold-light);
}

.mw-send:disabled,
.mw-send:disabled:hover {
  opacity: 0.4;
  cursor: not-allowed;
}

.pulse-text {
  animation: pulse 2s infinite;
  color: #c6aa6b;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* Full view css */
body.modal-open {
  overflow: hidden;
}

.fixed-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-content {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  padding: 1rem;
}

.close-buttom {
  position: absolute;
  top: calc(1rem + 10px);
  right: calc(1rem + 15px);
  color: white;
  font-size: 2rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 9999;
}

.modal-image {
  max-height: 90vh;
  max-width: 90vw;
  border-radius: 0.75rem;
}

.full-screen-text {
  min-width: 300px;
  max-width: 600px;
  aspect-ratio: 1;
  border: 20px solid transparent;
  border-image: url('https://d2y4hiq4ddyigd.cloudfront.net/border.png') 64 fill stretch;
  display: flex;
  justify-content: center;
  align-items: center;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.full-screen-text > div {
  max-width: 90vw;
  max-height: 400px;
  color: white;
  white-space: pre-line;
  overflow-y: auto;
  word-break: break-word;
  scrollbar-width: none;
  padding: 15px 53px;
}

.full-screen-text .text {
  margin-bottom: 20px;
}

