/* ==========================================================
   berkaycakir.co
   90'lar / 2000'ler kisisel site temasi
   Butun animasyonlar CSS ile, disaridan tek bir dosya yuklenmez.
   ========================================================== */

:root {
  --neon:   #39ff14;
  --hot:    #ff00ff;
  --cyan:   #00ffff;
  --yellow: #ffff00;
  --orange: #ff9900;
  --panel:  rgba(0, 0, 90, 0.82);
  --line:   #00ffff;
  --muted:  #9df7ff;
  --accent: #ffff00;
  --ink:    #e8ffe8;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", cursive, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  background-color: #000010;
  overflow-x: hidden;
}

/* --- Kayan yildizli arka plan (iki katman, farkli hizlarda) --- */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: -2;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(1.6px 1.6px at 25px 15px,  #ffffff, transparent),
    radial-gradient(1.6px 1.6px at 90px 62px,  #b3e5ff, transparent),
    radial-gradient(2.2px 2.2px at 150px 110px, #fff5b3, transparent),
    radial-gradient(1.2px 1.2px at 60px 172px, #ffffff, transparent),
    radial-gradient(1.8px 1.8px at 185px 40px, #ffb3f7, transparent);
  background-size: 200px 200px;
  animation: drift 24s linear infinite;
}

body::after {
  background-image:
    radial-gradient(1px 1px at 45px 55px,  #ffffff, transparent),
    radial-gradient(1px 1px at 130px 20px, #a0ffe0, transparent),
    radial-gradient(1px 1px at 170px 150px, #ffffff, transparent);
  background-size: 320px 320px;
  opacity: 0.75;
  animation: drift 52s linear infinite reverse;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-200px, 200px, 0); }
}

/* --- Ust kisim --- */
.hero {
  position: relative;
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

/* Baslik arkasinda donen isik huzmesi */
.hero::before {
  content: "";
  position: absolute;
  top: 45%;
  left: 50%;
  width: 30rem;
  height: 30rem;
  margin: -15rem 0 0 -15rem;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 0, 255, 0.22), rgba(0, 255, 255, 0.05),
    rgba(255, 255, 0, 0.22), rgba(0, 255, 255, 0.05),
    rgba(255, 0, 255, 0.22));
  animation: spin 14s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.kicker {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  color: var(--cyan);
  text-shadow: 0 0 6px var(--cyan);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 8.5vw, 3.6rem);
  line-height: 1.15;
  color: var(--yellow);
  text-shadow:
    2px 2px 0 #ff00ff,
    4px 4px 0 #0000ff,
    0 0 18px rgba(255, 255, 0, 0.55);
  animation: wobble 3.4s ease-in-out infinite;
}

@keyframes wobble {
  0%, 100% { transform: rotate(-1.6deg) scale(1); }
  50%      { transform: rotate(1.6deg) scale(1.04); }
}

.hero .sub {
  margin: 1rem 0 0;
  font-size: 0.95rem;
  color: var(--neon);
  text-shadow: 0 0 6px rgba(57, 255, 20, 0.7);
}

/* Bolumleri ayiran gokkusagi cizgi */
.hero::after {
  content: "";
  display: block;
  height: 6px;
  margin: 1.5rem auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg,
    #ff0000, #ff9900, #ffff00, #33ff00, #00ffff, #0066ff, #cc00ff, #ff0000);
  background-size: 300% 100%;
  animation: rainbow 3s linear infinite;
}

@keyframes rainbow {
  from { background-position:   0% 50%; }
  to   { background-position: 300% 50%; }
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
}

/* --- Sarki kutusu --- */
.song {
  position: relative;
  background: var(--panel);
  border: 5px ridge var(--neon);
  border-radius: 6px;
  padding: 2rem 1.75rem;
  box-shadow:
    0 0 18px rgba(57, 255, 20, 0.55),
    inset 0 0 34px rgba(0, 255, 255, 0.12);
}

.part + .part { margin-top: 2rem; }

.part h2 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--hot);
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.8);
}

.verse {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.95;
  text-shadow: 0 0 5px rgba(160, 255, 200, 0.35);
}

.chorus-part {
  padding: 0.9rem 1rem 0.9rem 1.1rem;
  border: 3px double var(--yellow);
  border-radius: 5px;
  background: rgba(255, 0, 255, 0.14);
}

.chorus-part .verse {
  color: var(--yellow);
  font-style: italic;
  text-shadow: 0 0 7px rgba(255, 255, 0, 0.6);
}

/* Gece temasi (Astronot Amca): biraz daha mor */
body.theme-night .song {
  background: rgba(30, 0, 70, 0.82);
  border-color: var(--hot);
  box-shadow:
    0 0 18px rgba(255, 0, 255, 0.6),
    inset 0 0 34px rgba(120, 0, 255, 0.2);
}

/* --- Ana sayfadaki sarki listesi --- */
.song-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.song-list a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--panel);
  border: 4px outset var(--cyan);
  border-radius: 5px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
}

.song-list a:hover,
.song-list a:focus-visible {
  background: rgba(120, 0, 140, 0.85);
  border-style: inset;
  border-color: var(--yellow);
  box-shadow: 0 0 20px var(--yellow);
}

.song-emoji {
  font-size: 1.9rem;
  line-height: 1;
  flex: none;
  animation: bounce 1.8s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0)      rotate(-6deg); }
  50%      { transform: translateY(-7px)   rotate(6deg); }
}

.song-meta { display: flex; flex-direction: column; min-width: 0; }

.song-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--yellow);
  text-shadow: 1px 1px 0 var(--hot);
}

.song-line {
  font-size: 0.87rem;
  font-style: italic;
  color: var(--muted);
}

/* Ana sayfadaki oyunlar baglantisi biraz one ciksin */
.game-link { margin-top: 0.9rem; }

.game-link a { border-color: var(--hot); box-shadow: 0 0 14px rgba(255, 0, 255, 0.55); }

/* --- Sayfalar arasi gezinme dugmeleri --- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.pager a {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  color: #000080;
  background: linear-gradient(#f0f0f0, #b8b8c8);
  border: 3px outset #dcdcdc;
  border-radius: 3px;
  text-decoration: none;
  font-weight: bold;
}

.pager a:hover { border-style: inset; background: linear-gradient(#ffffcc, #e0e070); }

.back {
  color: var(--cyan);
  font-weight: bold;
  text-decoration: underline;
}

.back:hover { color: var(--yellow); }

/* --- Onemli not kutusu --- */
.note {
  max-width: 46rem;
  margin: 1.5rem auto 0;
  padding: 0.9rem 1.1rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #fff8b0;
  background: rgba(80, 0, 0, 0.6);
  border: 3px dashed var(--orange);
  border-radius: 5px;
}

.note p { margin: 0; }

.note::before {
  content: "!!! ONEMLI NOT !!!";
  display: block;
  margin-bottom: 0.35rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  color: var(--orange);
  text-shadow: 0 0 7px rgba(255, 153, 0, 0.8);
}

footer {
  padding: 0 1.5rem 3rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
}

footer p { margin: 0; }

/* ==========================================================
   retro.js tarafindan eklenen sus parcalari
   ========================================================== */

/* Ustteki kayan yazi seridi */
.marquee-bar {
  overflow: hidden;
  white-space: nowrap;
  padding: 0.4rem 0;
  background: linear-gradient(#000080, #000040);
  border-bottom: 3px ridge var(--cyan);
  color: var(--yellow);
  font-weight: bold;
  font-size: 0.9rem;
}

.marquee-bar span {
  display: inline-block;
  padding-left: 100%;
  animation: slide 26s linear infinite;
}

@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* Yanip sonen yazi */
.blink { animation: blink 1.1s steps(2, start) infinite; }

@keyframes blink { to { visibility: hidden; } }

/* "Yapim asamasinda" seridi */
.construction {
  max-width: 46rem;
  margin: 1.25rem auto 0;
  padding: 0.55rem 1rem;
  text-align: center;
  font-weight: bold;
  font-size: 0.85rem;
  color: #000;
  border: 3px solid #000;
  border-radius: 4px;
  background-image: repeating-linear-gradient(
    45deg, #ffd400 0 14px, #1a1a1a 14px 28px);
  background-size: 40px 40px;
  animation: stripes 1.1s linear infinite;
  text-shadow: 0 0 6px #ffd400, 0 0 12px #ffd400;
}

@keyframes stripes {
  from { background-position: 0 0; }
  to   { background-position: 40px 0; }
}

/* Sahte midi calar + ekolayzir */
.midi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.25rem auto 0;
  padding: 0.5rem 0.9rem;
  max-width: 26rem;
  font-size: 0.82rem;
  color: var(--neon);
  background: rgba(0, 0, 0, 0.75);
  border: 3px inset #707090;
  border-radius: 4px;
}

.midi-btn {
  padding: 0.25rem 0.6rem;
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: bold;
  color: #000080;
  background: linear-gradient(#f0f0f0, #b8b8c8);
  border: 3px outset #dcdcdc;
  border-radius: 3px;
  cursor: pointer;
}

.midi-btn:active { border-style: inset; }

.midi-btn:hover { background: linear-gradient(#ffffcc, #e0e070); }

.midi-hint { font-size: 0.72rem; color: var(--yellow); }

.eq { display: flex; align-items: flex-end; gap: 3px; height: 20px; }

.eq i {
  display: block;
  width: 4px;
  background: linear-gradient(#39ff14, #ffff00);
  transform: scaleY(0.3);
  transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
  animation-play-state: paused;
}

/* Cubuklar yalnizca muzik calarken oynasin */
.midi.playing .eq i { animation-play-state: running; }

.eq i:nth-child(1) { animation-delay: 0s;    height: 40%; }
.eq i:nth-child(2) { animation-delay: 0.15s; height: 75%; }
.eq i:nth-child(3) { animation-delay: 0.3s;  height: 55%; }
.eq i:nth-child(4) { animation-delay: 0.45s; height: 90%; }
.eq i:nth-child(5) { animation-delay: 0.6s;  height: 60%; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.35); }
  50%      { transform: scaleY(1); }
}

/* Ziyaretci sayaci */
.counter {
  margin: 1.5rem auto 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--cyan);
}

.counter .digits {
  display: inline-flex;
  gap: 3px;
  margin: 0 0.3rem;
  vertical-align: middle;
}

.counter .digits b {
  display: inline-block;
  min-width: 1.15em;
  padding: 0.15rem 0.2rem;
  font-family: "Courier New", monospace;
  font-size: 1.1rem;
  color: var(--neon);
  background: #000;
  border: 2px inset #666;
  border-radius: 2px;
  text-shadow: 0 0 8px var(--neon);
}

/* Alttaki rozetler */
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 auto 1rem;
  max-width: 34rem;
}

.badge {
  padding: 0.25rem 0.5rem;
  font-size: 0.65rem;
  font-family: "Courier New", monospace;
  font-weight: bold;
  line-height: 1.25;
  color: #fff;
  background: #202060;
  border: 2px outset #8080c0;
  border-radius: 2px;
}

.badge.b2 { background: #601010; border-color: #c08080; }
.badge.b3 { background: #106010; border-color: #80c080; }
.badge.b4 { background: #603010; border-color: #c0a080; }

/* Fare izindeki yildizlar */
.sparkle {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  font-size: 12px;
  animation: fade 0.9s linear forwards;
}

@keyframes fade {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to   { opacity: 0; transform: translate(0, 22px) scale(0.4); }
}

/* ==========================================================
   OYUNLAR
   ========================================================== */
.game {
  margin-bottom: 1.5rem;
  padding: 1.4rem 1.25rem;
  text-align: center;
  background: var(--panel);
  border: 5px ridge var(--cyan);
  border-radius: 6px;
  box-shadow:
    0 0 18px rgba(0, 255, 255, 0.5),
    inset 0 0 30px rgba(255, 0, 255, 0.1);
}

.game h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  color: var(--yellow);
  text-shadow: 2px 2px 0 var(--hot), 0 0 14px rgba(255, 255, 0, 0.5);
}

.game-help {
  margin: 0 0 0.9rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.game-msg {
  min-height: 1.4em;
  margin: 0.6rem 0 0;
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--neon);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.7);
}

.scoreline {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  margin-bottom: 0.8rem;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--cyan);
}

.scoreline b {
  color: var(--neon);
  text-shadow: 0 0 8px var(--neon);
}

/* --- Yilan --- */
#snake {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  background: #000018;
  border: 4px inset #6060a0;
  border-radius: 4px;
  touch-action: manipulation;
}

/* Dokunmatik yon tuslari */
.dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.75rem;
}

.dpad > div { display: flex; gap: 2.6rem; }

.dpad button {
  width: 2.9rem;
  height: 2.3rem;
  font-size: 1rem;
  color: #000080;
  background: linear-gradient(#f0f0f0, #b8b8c8);
  border: 3px outset #dcdcdc;
  border-radius: 3px;
  cursor: pointer;
}

.dpad button:active { border-style: inset; }

/* --- Hafiza kartlari --- */
.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  max-width: 20rem;
  margin: 0 auto;
}

.card {
  aspect-ratio: 1 / 1;
  font-size: 1.6rem;
  font-family: inherit;
  color: var(--cyan);
  background: linear-gradient(#202060, #101038);
  border: 3px outset #6060a0;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.card:hover { background: linear-gradient(#303080, #202050); }

.card.open {
  background: linear-gradient(#ffffcc, #e0e070);
  border-style: inset;
}

.card.done {
  background: linear-gradient(#39ff14, #1a8f0a);
  border-style: inset;
  cursor: default;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.8);
}

/* eski tarayicilarda aspect-ratio yoksa kart yine de kare dursun */
@supports not (aspect-ratio: 1 / 1) {
  .card { height: 4.2rem; }
}

/* --- Ortak skor tablosu --- */
.board-wrap {
  max-width: 22rem;
  margin: 1.1rem auto 0;
  padding-top: 0.9rem;
  border-top: 2px dashed rgba(0, 255, 255, 0.4);
}

.board-wrap h3 {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--hot);
  text-shadow: 0 0 8px rgba(255, 0, 255, 0.8);
}

.board {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sira;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
}

.board li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.2rem 0.4rem;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.18);
}

.board li:nth-child(odd) { background: rgba(0, 0, 0, 0.3); }

/* sira numarasi */
.board li:not(.board-empty)::before {
  counter-increment: sira;
  content: counter(sira) ".";
  min-width: 1.7em;
  text-align: right;
  color: var(--muted);
}

/* ilk uc biraz parlasin */
.board li:nth-child(1) b { color: #ffd700; text-shadow: 0 0 8px #ffd700; }
.board li:nth-child(2) b { color: #d8d8e8; }
.board li:nth-child(3) b { color: #ff9955; }

.board li span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  color: var(--ink);
}

.board li b { color: var(--neon); }

.board-empty {
  justify-content: center;
  color: var(--muted);
  font-style: italic;
}

.board-empty::before { content: none; }

/* isim girme satiri */
.save-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.8rem 0 0;
}

.name-input {
  width: 9rem;
  padding: 0.3rem 0.5rem;
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: #000040;
  background: #f0f0f0;
  border: 3px inset #b0b0c0;
  border-radius: 3px;
}

.save-msg {
  width: 100%;
  font-size: 0.75rem;
  color: var(--yellow);
}

/* --- Tepki testi --- */
.reaction {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 22rem;
  min-height: 7rem;
  margin: 0 auto;
  padding: 1rem;
  font-weight: bold;
  font-size: 1rem;
  color: #000;
  border: 4px outset #8080c0;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
}

.reaction.idle  { background: linear-gradient(#c0c0d0, #9090a8); color: #000040; }
.reaction.wait  { background: linear-gradient(#ff5555, #aa0000); color: #fff; }
.reaction.go    { background: linear-gradient(#66ff66, #00aa00); color: #003300; }
.reaction.early { background: linear-gradient(#ffaa33, #cc6600); color: #331a00; }
.reaction.done  { background: linear-gradient(#ffff99, #dddd33); color: #333300; }

/* --- Kucuk ekranlar --- */
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero { padding-top: 1.75rem; }
  .song { padding: 1.4rem 1.1rem; }
  .song-title { font-size: 1.1rem; }
  .pager a { padding: 0.4rem 0.7rem; font-size: 0.82rem; }
  .game { padding: 1.1rem 0.75rem; }
  .card { font-size: 1.3rem; }
}

/* --- Hareket azaltma tercihi --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .blink { visibility: visible !important; }
}
