* {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Roboto', sans-serif;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      min-height: 100vh;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;
    }

    .container {
      background: white;
      border-radius: 20px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
      padding: 30px;
      max-width: 900px;
      width: 100%;
    }

    header {
      text-align: center;
      margin-bottom: 20px;
    }

    h1 {
      font-family: 'Press Start 2P', cursive;
      font-size: 28px;
      color: #667eea;
      text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }

    .game-info {
      margin-bottom: 20px;
    }

    .info-panel {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #f8f9fa;
      padding: 15px 20px;
      border-radius: 10px;
      margin-bottom: 15px;
    }

    .counter {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 700;
      font-size: 18px;
    }

    .counter .label {
      color: #666;
    }

    .counter .value {
      background: #000;
      color: #ff0000;
      padding: 5px 15px;
      border-radius: 5px;
      font-family: 'Press Start 2P', cursive;
      font-size: 16px;
      min-width: 60px;
      text-align: center;
    }

    .reset-btn {
      font-size: 32px;
      background: #fff;
      border: 3px solid #ddd;
      border-radius: 10px;
      width: 60px;
      height: 60px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .reset-btn:hover {
      transform: scale(1.1);
      border-color: #667eea;
    }

    .reset-btn:active {
      transform: scale(0.95);
    }

    .difficulty-selector {
      display: flex;
      gap: 10px;
      justify-content: center;
      flex-wrap: wrap;
    }

    .difficulty-btn {
      padding: 10px 20px;
      background: #f8f9fa;
      border: 2px solid #ddd;
      border-radius: 8px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }

    .difficulty-btn:hover {
      background: #e9ecef;
      border-color: #667eea;
    }

    .difficulty-btn.active {
      background: #667eea;
      color: white;
      border-color: #667eea;
    }

    .game-board {
      display: inline-grid;
      gap: 2px;
      background: #bdbdbd;
      padding: 10px;
      border-radius: 10px;
      margin: 0 auto;
      display: flex;
      justify-content: center;
    }

    .game-board-inner {
      display: inline-grid;
      gap: 2px;
      background: #bdbdbd;
      padding: 2px;
    }

    .cell {
      width: 30px;
      height: 30px;
      background: #d4d4d4;
      border: 3px solid;
      border-color: #fff #888 #888 #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
      font-size: 16px;
      cursor: pointer;
      user-select: none;
      transition: all 0.1s;
    }

    .cell:hover:not(.revealed):not(.flagged) {
      background: #e0e0e0;
    }

    .cell.revealed {
      background: #e0e0e0;
      border: 1px solid #bdbdbd;
      cursor: default;
    }

    .cell.mine {
      background: #ff4444;
    }

    .cell.flagged {
      background: #d4d4d4;
      font-size: 18px;
    }

    .cell[data-count="1"] { color: #0000ff; }
    .cell[data-count="2"] { color: #008000; }
    .cell[data-count="3"] { color: #ff0000; }
    .cell[data-count="4"] { color: #000080; }
    .cell[data-count="5"] { color: #800000; }
    .cell[data-count="6"] { color: #008080; }
    .cell[data-count="7"] { color: #000000; }
    .cell[data-count="8"] { color: #808080; }

    .instructions {
      margin-top: 30px;
      background: #f8f9fa;
      padding: 20px;
      border-radius: 10px;
    }

    .instructions h3 {
      color: #667eea;
      margin-bottom: 10px;
      font-size: 18px;
    }

    .instructions ul {
      list-style: none;
      padding-left: 0;
    }

    .instructions li {
      padding: 5px 0;
      color: #555;
    }

    .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.7);
      z-index: 1000;
      justify-content: center;
      align-items: center;
    }

    .modal.show {
      display: flex;
    }

    .modal-content {
      background: white;
      padding: 40px;
      border-radius: 20px;
      text-align: center;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
      animation: modalAppear 0.3s ease-out;
    }

    @keyframes modalAppear {
      from {
        transform: scale(0.7);
        opacity: 0;
      }
      to {
        transform: scale(1);
        opacity: 1;
      }
    }

    .modal-content h2 {
      font-family: 'Press Start 2P', cursive;
      font-size: 32px;
      margin-bottom: 20px;
      color: #667eea;
    }

    .modal-content p {
      font-size: 18px;
      color: #555;
      margin-bottom: 30px;
    }

    .modal-btn {
      padding: 15px 40px;
      background: #667eea;
      color: white;
      border: none;
      border-radius: 10px;
      font-size: 18px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }

    .modal-btn:hover {
      background: #5568d3;
      transform: translateY(-2px);
      box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    }

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

      h1 {
        font-size: 20px;
      }

      .cell {
        width: 25px;
        height: 25px;
        font-size: 14px;
      }

      .difficulty-btn {
        font-size: 12px;
        padding: 8px 15px;
      }
    }
