body {
  font-family: 'Noto Sans JP', sans-serif;
  text-align: center;
  background-color: #121212;
  color: white;
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #ff0000, #990000);
  z-index: 10;
}

.header {
  margin-bottom: 30px;
}

.logo {
  display: inline-block;
  background: linear-gradient(135deg, #ff0000 0%, #990000 100%);
  padding: 10px 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(255, 0, 0, 0.2);
  transform: skewX(-10deg);
  margin-bottom: 10px;
}

h1 {
  font-size: 2.2rem;
  margin: 0;
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  transform: skewX(10deg);
  letter-spacing: 1px;
}

.subtitle {
  font-size: 1.1rem;
  color: #ff3333;
  font-weight: bold;
  margin-top: 0;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 20px auto;
  max-width: 800px;
}

@media (min-width: 768px) {
  .game-container {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
  }
}

#game-board {
  width: 400px;
  height: 400px;
  background-color: #1e1e1e;
  border: 3px solid #333;
  border-radius: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

#status-panel {
  background-color: #1e1e1e;
  border: 2px solid #333;
  border-radius: 5px;
  padding: 15px;
  margin-left: 0;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  #status-panel {
    margin-left: 20px;
    margin-bottom: 0;
  }
}

#mode-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 10px;
  background-color: #333;
  border-radius: 5px;
}

.mode-label {
  font-weight: bold;
}

#current-mode {
  font-weight: bold;
  color: #fff;
  padding: 5px 10px;
  background-color: #555;
  border-radius: 3px;
  margin: 0 10px;
}

#transform-btn {
  background-color: #ff0000;
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

#transform-btn:hover {
  background-color: #cc0000;
  transform: translateY(-2px);
}

#mission-info,
#controls-info {
  text-align: left;
  margin-top: 20px;
  padding: 10px;
  background-color: #333;
  border-radius: 5px;
}

#mission-info h3,
#controls-info h3 {
  margin-top: 0;
  color: #ff3333;
  border-bottom: 1px solid #444;
  padding-bottom: 5px;
}

.controls {
  margin: 25px 0;
}

button {
  margin: 0 8px;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  transition: all 0.3s ease;
  font-family: 'Noto Sans JP', sans-serif;
}

.btn-primary {
  background-color: #ff0000;
  color: white;
}

.btn-primary:hover {
  background-color: #cc0000;
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(255, 0, 0, 0.2);
}

.btn-secondary {
  background-color: #333;
  color: white;
}

.btn-secondary:hover {
  background-color: #444;
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* ゲーム要素のスタイル */
.tile {
  width: 40px;
  height: 40px;
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.wall {
  background-color: #333;
  border: 1px solid #444;
}

.floor {
  background-color: #222;
  border: 1px solid #333;
}

.player {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  position: absolute;
  z-index: 10;
  transition: all 0.2s ease;
}

.player.salaryman {
  background-color: #3498db;
  border: 2px solid #2980b9;
}

.player.hero {
  background-color: #ff0000;
  border: 2px solid #cc0000;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.npc {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  position: absolute;
  background-color: #f1c40f;
  border: 2px solid #f39c12;
  z-index: 5;
}

.enemy {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  position: absolute;
  background-color: #9b59b6;
  border: 2px solid #8e44ad;
  z-index: 5;
}

.exit {
  background-color: #2ecc71;
  border: 2px solid #27ae60;
}

.message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 20px;
  border-radius: 5px;
  border: 2px solid #ff0000;
  z-index: 100;
  font-weight: bold;
  text-align: center;
}

/* モバイル用コントロール */
#mobile-controls {
  display: none;
  margin: 20px auto;
  max-width: 200px;
}

.d-pad {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.d-btn {
  position: absolute;
  width: 60px;
  height: 60px;
  background-color: #333;
  color: white;
  border: 2px solid #ff0000;
  border-radius: 10px;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.d-btn:active {
  background-color: #ff0000;
  transform: scale(0.95);
}

.d-btn.up {
  top: 0;
  left: 50px;
}

.d-btn.left {
  top: 50px;
  left: 0;
}

.d-btn.right {
  top: 50px;
  left: 100px;
}

.d-btn.down {
  top: 100px;
  left: 50px;
}

/* モバイルデバイス向けのスタイル調整 */
@media (max-width: 768px) {
  #mobile-controls {
    display: block;
  }

  #game-board {
    width: 300px;
    height: 300px;
  }

  .tile {
    width: 30px;
    height: 30px;
  }

  .player,
  .npc,
  .enemy {
    width: 22px;
    height: 22px;
  }

  .controls {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .controls button {
    margin: 5px 0;
    width: 80%;
    max-width: 250px;
  }
}