/* =====================================================
   나의 포털 사이트 - 레트로 스타일
   2000년대 쥬니어네이버 감성
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Noto+Sans+KR:wght@400;700;900&display=swap');

/* ===== 기본 리셋 ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Noto Sans KR', '맑은 고딕', Arial, sans-serif;
  background-color: #C8E6FF;
  background-image: radial-gradient(circle, #94C8E8 1px, transparent 1px);
  background-size: 22px 22px;
  min-height: 100vh;
  color: #222;
}

/* ===== 공통 포커스 스타일 ===== */
input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid #FFCC00;
  outline-offset: 1px;
}

/* ===== 스크롤바 ===== */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #C8E6FF; }
::-webkit-scrollbar-thumb { background: #0055CC; border-radius: 6px; border: 2px solid #C8E6FF; }
::-webkit-scrollbar-thumb:hover { background: #003399; }

/* =====================================================
   헤더
   ===================================================== */
.site-header {
  background: linear-gradient(180deg, #002288 0%, #0044BB 50%, #0066EE 100%);
  border-bottom: 4px solid #FFCC00;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-star {
  color: #FFCC00;
  font-size: 1.4rem;
  display: inline-block;
  animation: spin 4s linear infinite;
}

.logo-star:last-child {
  animation-direction: reverse;
}

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

.logo-text {
  font-family: 'Press Start 2P', monospace;
  color: #FFFFFF;
  font-size: 1.15rem;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 #001166, -1px -1px 0 #000033;
}

.header-date {
  color: #AADDFF;
  font-size: 0.8rem;
  text-align: right;
}

/* ===== 탭 네비게이션 ===== */
.tab-nav {
  display: flex;
  background: #001A77;
  padding: 0 12px;
  gap: 2px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: #99BBEE;
  padding: 10px 22px;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  border-top: 3px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #FFFFFF;
  background: #002299;
}

.tab-btn.active {
  color: #FFCC00;
  background: #002299;
  border-top-color: #FFCC00;
}

/* =====================================================
   메인 레이아웃
   ===================================================== */
.main-content {
  max-width: 1120px;
  margin: 24px auto;
  padding: 0 16px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #002299;
  border-left: 5px solid #FFCC00;
  padding-left: 12px;
  margin-bottom: 20px;
}

/* =====================================================
   공통 버튼
   ===================================================== */
.retro-btn {
  padding: 9px 22px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.12s;
  display: inline-block;
}

.retro-btn.primary {
  background: linear-gradient(180deg, #1188FF, #0055CC);
  color: #FFFFFF;
  border: 2px solid #003399;
  box-shadow: 3px 3px 0 #001166;
}

.retro-btn.primary:hover {
  background: linear-gradient(180deg, #44AAFF, #1188FF);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #001166;
}

.retro-btn.primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #001166;
}

.retro-btn.secondary {
  background: linear-gradient(180deg, #FFEE55, #FFCC00);
  color: #333333;
  border: 2px solid #CC9900;
  box-shadow: 3px 3px 0 #996600;
}

.retro-btn.secondary:hover {
  background: linear-gradient(180deg, #FFFF77, #FFEE55);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #996600;
}

.retro-btn.secondary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #996600;
}

/* =====================================================
   홈 탭
   ===================================================== */
.home-welcome {
  background: linear-gradient(135deg, #FFFDE7, #FFF9C4, #FFFDE7);
  border: 3px solid #FFCC00;
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  box-shadow: 4px 4px 0 #FFB300;
  margin-bottom: 18px;
}

.blink-text {
  font-size: 1.6rem;
  font-weight: 900;
  color: #FF5500;
  animation: blink 1s step-end infinite;
  margin-bottom: 8px;
}

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

.home-welcome p {
  color: #664400;
  font-size: 1rem;
}

.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.shortcut-card {
  background: #FFFFFF;
  border: 2px solid #0055CC;
  border-radius: 12px;
  padding: 24px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 3px 3px 0 #0055CC;
  user-select: none;
}

.shortcut-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #0055CC;
  background: #EEF4FF;
}

.shortcut-card:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 #0055CC;
}

.shortcut-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.shortcut-label {
  font-weight: 700;
  color: #002299;
  font-size: 0.95rem;
}

.home-weather-mini {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
  border: 2px solid #1976D2;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 3px 3px 0 #1565C0;
}

.widget-title {
  font-weight: 700;
  color: #1565C0;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* =====================================================
   번역기 탭
   ===================================================== */
.translator-config {
  background: #FFFBE6;
  border: 1px dashed #FFCC00;
  border-radius: 6px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 0.83rem;
  color: #555;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.translator-config input {
  padding: 4px 8px;
  border: 1px solid #CCAA00;
  border-radius: 4px;
  font-size: 0.83rem;
  width: 260px;
}

.config-hint {
  color: #999;
  font-size: 0.78rem;
}

.config-hint code {
  background: #EEE;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
}

.translator-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: #FFFFFF;
  border: 3px solid #0055CC;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 4px 4px 0 #003399;
}

.lang-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lang-select-row select {
  flex: 1;
  padding: 6px 8px;
  border: 2px solid #0055CC;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.9rem;
  background: #EEF4FF;
  cursor: pointer;
}

.swap-btn {
  background: #FFCC00;
  border: 2px solid #CC9900;
  border-radius: 5px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.2s;
  box-shadow: 2px 2px 0 #996600;
}

.swap-btn:hover { transform: scale(1.15); }

.translator-left textarea {
  width: 100%;
  min-height: 160px;
  border: 2px solid #AACCFF;
  border-radius: 6px;
  padding: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  margin-bottom: 10px;
  line-height: 1.6;
}

.lang-label {
  font-size: 0.83rem;
  color: #666;
  margin-bottom: 6px;
  font-weight: 700;
}

.result-area {
  width: 100%;
  min-height: 160px;
  border: 2px solid #AACCFF;
  border-radius: 6px;
  padding: 10px;
  font-size: 0.95rem;
  background: #F7FAFF;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  margin-bottom: 10px;
}

.placeholder-text { color: #AAA; }

/* =====================================================
   날짜 계산기 탭
   ===================================================== */
.date-calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.calc-card {
  background: #FFFFFF;
  border: 3px solid #0055CC;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 4px 4px 0 #003399;
}

.calc-card-title {
  font-weight: 900;
  color: #002299;
  font-size: 1rem;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px dashed #AACCFF;
}

.calc-card label {
  display: block;
  font-size: 0.85rem;
  color: #555;
  font-weight: 700;
  margin-bottom: 12px;
}

.calc-card label input {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 2px solid #AACCFF;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.9rem;
  margin-top: 5px;
}

.calc-card label input:hover {
  border-color: #0055CC;
}

.calc-card .retro-btn {
  margin-top: 4px;
  width: 100%;
}

.calc-result {
  margin-top: 12px;
  padding: 10px 12px;
  background: #EEF4FF;
  border-radius: 6px;
  border-left: 4px solid #0055CC;
  font-weight: 700;
  min-height: 42px;
  color: #002299;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* =====================================================
   날씨 탭
   ===================================================== */
.weather-container {
  background: #FFFFFF;
  border: 3px solid #0055CC;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 4px 4px 0 #003399;
}

.weather-search {
  text-align: center;
  margin-bottom: 24px;
}

.weather-display {
  text-align: center;
}

.weather-hint {
  color: #999;
  font-style: italic;
}

.weather-card {
  display: inline-block;
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB, #E3F2FD);
  border: 2px solid #1976D2;
  border-radius: 16px;
  padding: 28px 40px;
  min-width: 280px;
  box-shadow: 4px 4px 0 #1565C0;
}

.weather-icon-big {
  font-size: 4.5rem;
  margin-bottom: 10px;
  display: block;
}

.weather-temp {
  font-size: 2.8rem;
  font-weight: 900;
  color: #0D47A1;
  margin-bottom: 4px;
}

.weather-desc {
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 4px;
}

.weather-details {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 12px;
  font-size: 0.9rem;
  color: #555;
}

.weather-location {
  margin-top: 10px;
  font-size: 0.75rem;
  color: #999;
}

/* =====================================================
   게임 탭
   ===================================================== */
.games-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: start;
}

.game-section {
  background: #FFFFFF;
  border: 3px solid #0055CC;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 4px 4px 0 #003399;
}

.game-title {
  font-weight: 900;
  color: #002299;
  font-size: 1.05rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid #FFCC00;
}

/* 테트리스 */
.tetris-container {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

#tetris-canvas {
  border: 3px solid #0033AA;
  background: #000011;
  image-rendering: pixelated;
  display: block;
  flex-shrink: 0;
}

.tetris-info {
  flex: 1;
  min-width: 110px;
}

.tetris-score-box {
  background: #000A2E;
  color: #00FF88;
  border: 2px solid #00AA55;
  border-radius: 5px;
  padding: 8px 10px;
  text-align: center;
  margin-bottom: 8px;
  font-family: 'Press Start 2P', monospace;
}

.score-label {
  font-size: 0.55rem;
  color: #55BB88;
  letter-spacing: 1px;
}

.score-value {
  font-size: 1.1rem;
  margin-top: 4px;
  color: #00FF88;
}

.tetris-controls {
  font-size: 0.75rem;
  color: #555;
  line-height: 2;
  margin: 10px 0;
  padding: 8px;
  background: #F5F5F5;
  border-radius: 5px;
  border: 1px solid #DDD;
}

/* 유니티 슬롯 */
.unity-container {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.unity-placeholder {
  text-align: center;
  color: #888;
}

.unity-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.unity-placeholder p {
  margin-bottom: 8px;
  line-height: 1.6;
}

.unity-guide {
  font-size: 0.85rem;
  color: #999;
  line-height: 1.8 !important;
}

.unity-guide code {
  background: #EEE;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: monospace;
  color: #333;
}

/* =====================================================
   푸터
   ===================================================== */
.site-footer {
  background: linear-gradient(180deg, #001A77, #002299);
  border-top: 4px solid #FFCC00;
  padding: 10px 0;
  margin-top: 40px;
}

.footer-marquee {
  color: #AACCFF;
  font-size: 0.88rem;
}

/* =====================================================
   반응형
   ===================================================== */
@media (max-width: 900px) {
  .home-shortcuts {
    grid-template-columns: repeat(2, 1fr);
  }

  .date-calc-grid {
    grid-template-columns: 1fr;
  }

  .translator-box {
    grid-template-columns: 1fr;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .tetris-container {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .logo-text {
    font-size: 0.85rem;
  }

  .tab-btn {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .home-shortcuts {
    grid-template-columns: repeat(2, 1fr);
  }
}
