/* 顶部区域布局 - 摸鱼时间缩小，修仙板块增大 */
.top-section {
  display: grid;
  grid-template-columns: 1fr 2fr; /* 修仙板块变为2倍大小 */
  gap: 20px;
  margin: 30px 0;
  padding: 0 15px;
}

/* 第二行布局 - 角色属性和日志系统 */
.second-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
  padding: 0 15px;
}

/* 摸鱼时间卡片样式 - 更紧凑 */
.fish-time-container {
  display: flex;
  justify-content: center;
}

.fish-time-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  padding: 20px;
  color: white;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 3px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  width: 100%;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
}

.fish-time-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fish-icon {
  font-size: 2.5rem;
  animation: swim 3s ease-in-out infinite;
}

@keyframes swim {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(3deg); }
}

.fish-time-content h3 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  opacity: 0.9;
}

.fish-time-display {
  font-size: 1.5rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.fish-subtitle {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 3px;
}

.reset-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.75rem;
  margin-top: 8px;
  transition: all 0.3s ease;
}

.reset-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.fish-animation {
  position: absolute;
  right: 15px;
  top: 15px;
}

.bubble {
  width: 8px;
  height: 8px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  position: absolute;
  animation: bubble 4s infinite;
}

.bubble:nth-child(1) { animation-delay: 0s; }
.bubble:nth-child(2) { animation-delay: 1.3s; left: 12px; }
.bubble:nth-child(3) { animation-delay: 2.6s; left: 24px; }

@keyframes bubble {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-50px) scale(0.3); opacity: 0; }
}

/* ---- 修仙系统独立卡片样式 - 增大 ---- */
.cultivation-container {
  display: flex;
  justify-content: center;
}

.cultivation-card {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  border-radius: 20px;
  padding: 30px;
  color: #fff;
  box-shadow: 0 15px 50px rgba(255,107,107,0.2), 0 6px 20px rgba(255,107,107,0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  width: 100%;
  position: relative;
}

.cultivation-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(255,107,107,0.25), 0 8px 25px rgba(255,107,107,0.2);
}

.cultivation-title {
  font-weight: 700;
  color: #fff3c4;
  font-size: 1.2rem;
  margin-bottom: 10px;
  text-align: center;
}

.cultivation-status {
  font-size: 1.1rem;
  opacity: 0.95;
  text-align: center;
  margin-bottom: 8px;
}

.cultivation-desc {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: 8px;
  color: #f7f3e7;
  text-align: center;
  line-height: 1.4;
}

.cultivation-progress-wrap {
  width: 100%;
  height: 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 15px 0;
}

.cultivation-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd54f 0%, #ffb74d 50%, #ff8a65 100%);
  transition: width 0.5s ease;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(255, 213, 79, 0.5);
}

.cultivation-tribulation-btn {
  margin-top: 15px;
  padding: 8px 16px;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  transition: all 0.3s ease;
}

.cultivation-tribulation-btn:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

/* 角色属性卡片样式 */
.attributes-container {
  display: flex;
  justify-content: center;
}
.offline-info {
  margin-top: 5px;
  font-size: 14px;
  color: #ffd700;
}

.attribute-tip {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: rgba(255, 223, 0, 0.9);
  color: #222;
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 1;
  pointer-events: none;
  z-index: 9999;
  animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
  0% { transform: translateX(-50%) translateY(0); opacity: 1; }
  50% { transform: translateX(-50%) translateY(-20px); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-40px); opacity: 0; }
}

.attributes-card {
  background: linear-gradient(135deg, #4fc3e0 0%, #40abd8 100%);
  border-radius: 20px;
  padding: 25px;
  color: #fff;
  box-shadow: 0 15px 50px rgba(76, 175, 80, 0.2), 0 6px 20px rgba(76, 175, 80, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  width: 100%;
}

.attributes-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(76, 175, 80, 0.25), 0 8px 25px rgba(76, 175, 80, 0.2);
}

.attributes-title {
  font-weight: 700;
  color: #e8f5e8;
  font-size: 1.1rem;
  margin-bottom: 15px;
  text-align: center;
}

.attr-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.attr-item {
  font-size: 0.9rem;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 5px;
}

.attr-item strong {
  color: #fff;
  font-weight: 700;
}

/* 修炼日志卡片样式 */
.logs-container {
  display: flex;
  justify-content: center;
}

.logs-card {
  background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
  border-radius: 20px;
  padding: 25px;
  color: #fff;
  box-shadow: 0 15px 50px rgba(156, 39, 176, 0.2), 0 6px 20px rgba(156, 39, 176, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
  width: 100%;
}

.logs-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 60px rgba(156, 39, 176, 0.25), 0 8px 25px rgba(156, 39, 176, 0.2);
}

.logs-title {
  font-weight: 700;
  color: #f3e5f5;
  font-size: 1.1rem;
  margin-bottom: 15px;
  text-align: center;
}

.cultivation-logs {
  max-height: 200px;
  overflow-y: auto;
  padding-right: 5px;
}

.log-entry {
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 0.85rem;
  line-height: 1.3;
  border-left: 3px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
}

.log-entry:hover {
  background: rgba(255,255,255,0.15);
  transform: translateX(2px);
}

/* 自定义滚动条 */
.cultivation-logs::-webkit-scrollbar {
  width: 4px;
}

.cultivation-logs::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.cultivation-logs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.cultivation-logs::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.5);
}

/* 游戏容器布局 */
.game-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  margin: 30px 0;
}

@media (max-width: 768px) {
  .top-section {
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 20px 0;
  }

  .second-section {
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 15px 0;
  }

  .game-container {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 20px 0;
  }

  .fish-time-card {
    padding: 15px;
  }

  .fish-time-header {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .cultivation-card,
  .attributes-card,
  .logs-card {
    width: 100%;
    padding: 20px;
  }

  .fish-animation {
    position: static;
    margin: 8px 0;
  }
}

@media (max-width: 480px) {
  .fish-time-container {
    margin: 10px 0;
    padding: 0 10px;
  }

  .fish-time-card {
    padding: 12px;
    border-radius: 12px;
  }

  .cultivation-card,
  .attributes-card,
  .logs-card {
    padding: 15px;
    border-radius: 15px;
  }

  .game-card, .leaderboard-card {
    padding: 15px;
    border-radius: 15px;
  }

  #gameCanvas {
    width: 100%;
    max-width: 300px;
    height: auto;
  }

  .game-stats {
    flex-direction: column;
    gap: 10px;
  }

  .stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .attr-row {
    flex-direction: column;
    gap: 5px;
  }

  .attr-item {
    justify-content: space-between;
  }
}

/* 游戏卡片样式 */
.game-card, .leaderboard-card {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.08), 0 5px 15px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.game-card:hover, .leaderboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.08);
}

.game-card h3, .leaderboard-card h3 {
  text-align: center;
  margin: 0 0 20px 0;
  color: #333;
  font-size: 1.5rem;
}

.game-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
}

.stat-item {
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 5px;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

#gameCanvas {
  border: 3px solid #333;
  border-radius: 15px;
  display: block;
  margin: 0 auto 20px auto;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15), inset 0 1px 3px rgba(255,255,255,0.2);
  transition: all 0.3s ease;
}

#gameCanvas:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 30px rgba(0,0,0,0.2), inset 0 1px 3px rgba(255,255,255,0.3);
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.game-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
  background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
  color: #333;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.game-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.game-btn:hover::before {
  left: 100%;
}

.game-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.game-btn.primary {
  background: linear-gradient(45deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.game-btn.primary:hover {
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.game-tips {
  text-align: center;
  color: #666;
  font-size: 0.85rem;
}

/* 昵称输入样式 */
.nickname-section {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 2px dashed #ddd;
}

.nickname-input-group {
  text-align: center;
}

.nickname-input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

#player-nickname {
  width: 200px;
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 20px;
  text-align: center;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s ease;
}

#player-nickname:focus {
  border-color: #4CAF50;
}

#player-nickname.invalid {
  border-color: #ff4757;
  background-color: #ffe6e6;
}

.nickname-rules {
  margin-top: 5px;
  color: #666;
}

.nickname-error {
  color: #ff4757;
  font-size: 0.8rem;
  margin-top: 5px;
}

.nickname-section.hidden {
  display: none;
}

/* 排行榜样式 */
.current-player {
  background: linear-gradient(45deg, #FFD700, #FFA500);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: center;
}

.player-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  font-weight: bold;
  margin-bottom: 10px;
}

.change-nickname-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.3s ease;
}

.change-nickname-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

.player-name {
  font-size: 1.1rem;
}

.player-score {
  font-size: 1.2rem;
}

.leaderboard-list {
  max-height: 300px;
  overflow-y: auto;
}

#score-leaderboard {
  list-style: none;
  padding: 0;
  margin: 0;
}

#score-leaderboard li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-radius: 10px;
  border-left: 4px solid #ddd;
  transition: all 0.3s ease;
}

#score-leaderboard li:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

#score-leaderboard li:nth-child(1) {
  border-left-color: #FFD700;
  background: linear-gradient(45deg, #fff9c4, #fff);
}

#score-leaderboard li:nth-child(2) {
  border-left-color: #C0C0C0;
}

#score-leaderboard li:nth-child(3) {
  border-left-color: #CD7F32;
}

.rank-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rank-number {
  font-weight: bold;
  color: #666;
  min-width: 20px;
}

.player-name-rank {
  font-weight: 500;
}

.score-value {
  font-weight: bold;
  color: #333;
}

.leaderboard-footer {
  text-align: center;
  margin-top: 15px;
  color: #999;
}